Skip to content

Commit

Permalink
Add tests with failing Defn as opt-braces block
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 4, 2023
1 parent 4298a02 commit c9097e2
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scalafmt-tests/src/test/resources/scala3/OptionalBraces.stat
Original file line number Diff line number Diff line change
Expand Up @@ -5180,3 +5180,34 @@ object a:
object a:
List(1, 2, 3) map: x =>
x + 1
<<< #3653 try
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
>>>
test does not parse
object a:
try val x = 3 / 0
^
<<< #3653 if-!then
object a:
if (true)
val x = 3 / 0
>>>
test does not parse
object a:
if (true)
val x = 3 / 0
^
<<< #3653 for-!do
object a:
for (a <- b)
val x = 3 / 0
>>>
test does not parse
object a:
for (a <- b)
val x = 3 / 0
^
31 changes: 31 additions & 0 deletions scalafmt-tests/src/test/resources/scala3/OptionalBraces_fold.stat
Original file line number Diff line number Diff line change
Expand Up @@ -4947,3 +4947,34 @@ object a:
object a:
List(1, 2, 3) map: x =>
x + 1
<<< #3653 try
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
>>>
test does not parse
object a:
try val x = 3 / 0
^
<<< #3653 if-!then
object a:
if (true)
val x = 3 / 0
>>>
test does not parse
object a:
if (true)
val x = 3 / 0
^
<<< #3653 for-!do
object a:
for (a <- b)
val x = 3 / 0
>>>
test does not parse
object a:
for (a <- b)
val x = 3 / 0
^
32 changes: 32 additions & 0 deletions scalafmt-tests/src/test/resources/scala3/OptionalBraces_keep.stat
Original file line number Diff line number Diff line change
Expand Up @@ -5215,3 +5215,35 @@ object a:
object a:
List(1, 2, 3) map: x =>
x + 1
<<< #3653 try
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
>>>
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
<<< #3653 if-!then
object a:
if (true)
val x = 3 / 0
>>>
test does not parse
object a:
if (true)
val x = 3 / 0
^
<<< #3653 for-!do
object a:
for (a <- b)
val x = 3 / 0
>>>
test does not parse
object a:
for (a <- b)
val x = 3 / 0
^
Original file line number Diff line number Diff line change
Expand Up @@ -5346,3 +5346,35 @@ object a:
object a:
List(1, 2, 3) map: x =>
x + 1
<<< #3653 try
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
>>>
object a:
try
val x = 3 / 0
catch
case e: Throwable =>
<<< #3653 if-!then
object a:
if (true)
val x = 3 / 0
>>>
test does not parse
object a:
if (true)
val x = 3 / 0
^
<<< #3653 for-!do
object a:
for (a <- b)
val x = 3 / 0
>>>
test does not parse
object a:
for (a <- b)
val x = 3 / 0
^

0 comments on commit c9097e2

Please sign in to comment.