Skip to content

Commit

Permalink
Test AvoidInfix with match as lhs
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 20, 2024
1 parent 8bbf2f1 commit 695526e
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7564,3 +7564,50 @@ object Build:
}
}.evaluated
)
<<< AvoidInfix with match
rewrite.rules = [AvoidInfix]
===
object a {
a b c match
case _ =>
}
>>>
object a {
a.b(c) match
case _ =>
}
<<< AvoidInfix with match within applyinfix
rewrite.rules = [AvoidInfix]
===
object a {
a b c match {
case _ =>
} d e
}
>>>
test does not parse
[dialect scala3] `;` expected but `.` found
a .b( c) match {
case _ =>
} .d( e)
^
}
====== full result: ======
object a {
a .b( c) match {
case _ =>
} .d( e)
}
<<< AvoidInfix with match, with dot
rewrite.rules = [AvoidInfix]
===
object a {
(a.b(c)).match
case _ =>
}
>>>
object a {
(a.b(c))
.match
case _ =>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7275,3 +7275,49 @@ object Build:
config: GenerationConfig => config.remove[SiteRoot]
}
}.evaluated)
<<< AvoidInfix with match
rewrite.rules = [AvoidInfix]
===
object a {
a b c match
case _ =>
}
>>>
object a {
a.b(c) match
case _ =>
}
<<< AvoidInfix with match within applyinfix
rewrite.rules = [AvoidInfix]
===
object a {
a b c match {
case _ =>
} d e
}
>>>
test does not parse
[dialect scala3] `;` expected but `.` found
a .b( c) match {
case _ =>
} .d( e)
^
}
====== full result: ======
object a {
a .b( c) match {
case _ =>
} .d( e)
}
<<< AvoidInfix with match, with dot
rewrite.rules = [AvoidInfix]
===
object a {
(a.b(c)).match
case _ =>
}
>>>
object a {
(a.b(c)).match
case _ =>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7592,3 +7592,49 @@ object Build:
}
}.evaluated
)
<<< AvoidInfix with match
rewrite.rules = [AvoidInfix]
===
object a {
a b c match
case _ =>
}
>>>
object a {
a.b(c) match
case _ =>
}
<<< AvoidInfix with match within applyinfix
rewrite.rules = [AvoidInfix]
===
object a {
a b c match {
case _ =>
} d e
}
>>>
test does not parse
[dialect scala3] `;` expected but `.` found
a .b( c) match {
case _ =>
} .d( e)
^
}
====== full result: ======
object a {
a .b( c) match {
case _ =>
} .d( e)
}
<<< AvoidInfix with match, with dot
rewrite.rules = [AvoidInfix]
===
object a {
(a.b(c)).match
case _ =>
}
>>>
object a {
(a.b(c)).match
case _ =>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7879,3 +7879,49 @@ object Build:
}
.evaluated
)
<<< AvoidInfix with match
rewrite.rules = [AvoidInfix]
===
object a {
a b c match
case _ =>
}
>>>
object a {
a.b(c) match
case _ =>
}
<<< AvoidInfix with match within applyinfix
rewrite.rules = [AvoidInfix]
===
object a {
a b c match {
case _ =>
} d e
}
>>>
test does not parse
[dialect scala3] `;` expected but `.` found
a .b( c) match {
case _ =>
} .d( e)
^
}
====== full result: ======
object a {
a .b( c) match {
case _ =>
} .d( e)
}
<<< AvoidInfix with match, with dot
rewrite.rules = [AvoidInfix]
===
object a {
(a.b(c)).match
case _ =>
}
>>>
object a {
(a.b(c)).match
case _ =>
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
val explored = Debug.explored.get()
logger.debug(s"Total explored: $explored")
if (!onlyUnit && !onlyManual)
assertEquals(explored, 1082944, "total explored")
assertEquals(explored, 1083242, "total explored")
val results = debugResults.result()
// TODO(olafur) don't block printing out test results.
// I don't want to deal with scalaz's Tasks :'(
Expand Down

0 comments on commit 695526e

Please sign in to comment.