Skip to content

Commit

Permalink
Add test with braceless syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostbuster91 committed Aug 5, 2023
1 parent 8386b64 commit 1a592d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions compiler/test/dotty/tools/dotc/reporting/CodeActionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ class CodeActionTest extends DottyTest:
afterPhase = "patternMatcher"
)

@Test def insertMissingCasesUsingBracelessSyntax =
checkCodeAction(
code =
"""object Test:
| def foo(text: 1 | 2) = text match
| case 2 => ???
|""".stripMargin,
title = "Insert missing cases (1)",
expected =
"""object Test:
| def foo(text: 1 | 2) = text match
| case 2 => ???
| case 1 => ???
|""".stripMargin,
afterPhase = "patternMatcher"
)

// Make sure we're not using the default reporter, which is the ConsoleReporter,
// meaning they will get reported in the test run and that's it.
private def newContext =
Expand Down

0 comments on commit 1a592d3

Please sign in to comment.