You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use directives instead of scalac options in tests (#18560)
- update remaining `// scalac:` to `//> using options` in tests
- throw error when using old syntax in tests
fixes `scalac:` portion of #18149
still to do:
- rewrite `// test: -jvm 15+` to use a directive
- support `// scalajs: --skip` with a directive or similar
once this is done, we can remove the `toolArg` regex
case toolArg("scalac", _) => sys.error(s"`// scalac: args` not supported. Please use `//> using options args`${filename.fold("")(f =>s" in file $f")}")
93
+
case toolArg(name, args) =>List((name, args))
94
+
case _ =>Nil
95
+
} ++
91
96
lines.flatMap { case directiveOptionsArg(args) =>List(("scalac", args)) case _ =>Nil }
92
97
93
98
importorg.junit.Test
94
99
importorg.junit.Assert._
95
100
96
101
classToolArgsTest:
97
-
@Testdef`missing toolarg is absent`:Unit= assertEquals(Nil, toolArgsParse(List("")))
98
-
@Testdef`toolarg is present`:Unit= assertEquals(("test", " -hey") ::Nil, toolArgsParse("// test: -hey"::Nil))
99
-
@Testdef`tool is present`:Unit= assertEquals("-hey"::Nil, toolArgsFor(ToolName.Test)("// test: -hey"::Nil))
100
-
@Testdef`missing tool is absent`:Unit= assertEquals(Nil, toolArgsFor(ToolName.Javac)("// test: -hey"::Nil))
102
+
@Testdef`missing toolarg is absent`:Unit= assertEquals(Nil, toolArgsParse(List(""), None))
0 commit comments