File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
compiler/test/dotty/tools/dotc/reporting Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,25 @@ class CodeActionTest extends DottyTest:
8181 afterPhase = " patternMatcher"
8282 )
8383
84+ @ Test def insertMissingCasesForUnionStringType =
85+ checkCodeAction(
86+ code =
87+ """ object Test:
88+ | def foo(text: "Alice" | "Bob") = text match {
89+ | case "Alice" => ???
90+ | }
91+ |""" .stripMargin,
92+ title = " Insert missing cases (1)" ,
93+ expected =
94+ """ object Test:
95+ | def foo(text: "Alice" | "Bob") = text match {
96+ | case "Alice" => ???
97+ | case "Bob" => ???
98+ | }
99+ |""" .stripMargin,
100+ afterPhase = " patternMatcher"
101+ )
102+
84103 // Make sure we're not using the default reporter, which is the ConsoleReporter,
85104 // meaning they will get reported in the test run and that's it.
86105 private def newContext =
You can’t perform that action at this time.
0 commit comments