Skip to content

Commit 61c2084

Browse files
committed
ran scalafmt
1 parent 9a3427e commit 61c2084

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

scala-core-modules/scala-core/src/main/scala/com/baeldung/scala/patternmatching/PatternMatching.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ class PatternMatching {
9696
case s"$firstName.$lastName@$domain.$extension" =>
9797
s"Hey ${firstName.capitalize} ${lastName.capitalize}, $domain.$extension is your email domain"
9898
case s"$day-$month-${year}T$time" => s"$month $day, $year"
99-
case s"$something($parenthesis)${_}" => s"String between parenthesis: $parenthesis"
100-
case _ => "unknown pattern"
99+
case s"$something($parenthesis)${_}" =>
100+
s"String between parenthesis: $parenthesis"
101+
case _ => "unknown pattern"
101102
}
102103
}
103104

scala-core-modules/scala-core/src/test/scala/com/baeldung/scala/patternmatching/PatternMatchingUnitTest.scala

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,31 +157,41 @@ class PatternMatchingUnitTest {
157157

158158
@Test
159159
def whenEmailIsPassedWithComDomain_itShouldExtractParts(): Unit = {
160-
val result = new PatternMatching().stringInterpolationMatching("[email protected]")
160+
val result = new PatternMatching().stringInterpolationMatching(
161+
162+
)
161163
assertEquals("Hey James Kirk, starfleet.com is your email domain", result)
162164
}
163165

164166
@Test
165167
def whenEmailIsPassedWithCoInDomain_itShouldExtractParts(): Unit = {
166-
val result = new PatternMatching().stringInterpolationMatching("[email protected]")
168+
val result = new PatternMatching().stringInterpolationMatching(
169+
170+
)
167171
assertEquals("Hey James Kirk, starfleet.co.in is your email domain", result)
168172
}
169173

170174
@Test
171175
def whenDateTimeIsPassed_itShouldExtractDate(): Unit = {
172-
val result = new PatternMatching().stringInterpolationMatching("01-April-2024T10:20:30")
176+
val result = new PatternMatching().stringInterpolationMatching(
177+
"01-April-2024T10:20:30"
178+
)
173179
assertEquals("April 01, 2024", result)
174180
}
175181

176182
@Test
177183
def whenStringIsPassed_itShouldExtractDataBetweenParenthesis(): Unit = {
178-
val result = new PatternMatching().stringInterpolationMatching("Here is a (special) string")
184+
val result = new PatternMatching().stringInterpolationMatching(
185+
"Here is a (special) string"
186+
)
179187
assertEquals("String between parenthesis: special", result)
180188
}
181189

182190
@Test
183191
def whenUnknownDataIsPassed_itShouldReturnDefaultString(): Unit = {
184-
val result = new PatternMatching().stringInterpolationMatching("something-unknown.unmatched")
192+
val result = new PatternMatching().stringInterpolationMatching(
193+
"something-unknown.unmatched"
194+
)
185195
assertEquals("unknown pattern", result)
186196
}
187197

0 commit comments

Comments
 (0)