Skip to content

Commit

Permalink
Add test with case alternatives for source=keep
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 16, 2020
1 parent e8540f5 commit 354df7c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_keep.stat
Original file line number Diff line number Diff line change
Expand Up @@ -3116,3 +3116,51 @@ object a {
case _ =>
}
}
<<< #2219
a match {
case ( Root / "foo"
| Root / "bar"
| Root / "baz" / _ / "qux"
) =>
(if (foo) (foo) + bar
else foo + (bar)) + (baz)
case ( Root / "foo"
| Root / "bar"
| Root / "baz" / _ / "qux" ) => (foo)
}
>>>
a match {
case (Root / "foo" | Root / "bar" |
Root / "baz" / _ / "qux") =>
(if (foo) (foo) + bar
else foo + (bar)) + (baz)
case (Root / "foo" | Root / "bar" |
Root / "baz" / _ / "qux") => (
foo
)
}
<<< #2219 with spaces
spaces.inParentheses = true
===
a match {
case (Root / "foo"
| Root / "bar"
| Root / "baz" / _ / "qux"
) =>
(if (foo) (foo) + bar
else foo + (bar)) + (baz)
case (Root / "foo"
| Root / "bar"
| Root / "baz" / _ / "qux") => (foo)
}
>>>
a match {
case ( Root / "foo" | Root / "bar" |
Root / "baz" / _ / "qux") =>
( if (foo) ( foo) + bar
else foo + ( bar)) + ( baz)
case ( Root / "foo" | Root / "bar" |
Root / "baz" / _ / "qux") => (
foo
)
}

0 comments on commit 354df7c

Please sign in to comment.