Skip to content

Commit 0a30b3e

Browse files
committed
Add tests for commas being no longer accepted as using directive value separators on their own, and being deprecated otherwise
1 parent 804b470 commit 0a30b3e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

modules/integration/src/test/scala/scala/cli/integration/CompileScalacCompatTestDefinitions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ trait CompileScalacCompatTestDefinitions { _: CompileTestDefinitions =>
5454
),
5555
Seq(
5656
Seq(s"${dashPrefix}color:never"),
57-
Seq(s"\"${dashPrefix}language:noAutoTupling,strictEquality\"")
57+
Seq(s"${dashPrefix}language:noAutoTupling,strictEquality")
5858
),
5959
Seq(
6060
Seq(s"${dashPrefix}color", "never"),
61-
Seq(s"${dashPrefix}language", "\"noAutoTupling,strictEquality\"")
61+
Seq(s"${dashPrefix}language", "noAutoTupling,strictEquality")
6262
)
6363
)
6464
(cliOpts, directiveOpts) = {

modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,34 @@ class RunTestsDefault extends RunTestDefinitions
9595
.call(cwd = root)
9696
}
9797
}
98+
99+
test("meaningful commas dont have to be escaped in using directive values") {
100+
val inputPath = os.rel / "example.scala"
101+
TestInputs(inputPath ->
102+
"""//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar
103+
|import tabby.Grid
104+
|@main def main = println(Grid("a", "b", "c")(1, 2, 3))
105+
|""".stripMargin).fromRoot { root =>
106+
val res = os.proc(TestUtil.cli, "run", extraOptions, inputPath)
107+
.call(cwd = root)
108+
val out = res.out.trim()
109+
expect(out.contains("a, b, c"))
110+
}
111+
}
112+
113+
test(
114+
"using directives using commas with space as separators should produce a deprecation warning."
115+
) {
116+
val inputPath = os.rel / "example.sc"
117+
TestInputs(inputPath ->
118+
"""//> using options -Werror, -Wconf:cat=deprecation:e
119+
|println("Deprecation warnings should have been printed")
120+
|""".stripMargin)
121+
.fromRoot { root =>
122+
val res = os.proc(TestUtil.cli, "run", extraOptions, inputPath)
123+
.call(cwd = root, stderr = os.Pipe)
124+
val err = res.err.trim()
125+
expect(err.contains("Use of commas as separators is deprecated"))
126+
}
127+
}
98128
}

0 commit comments

Comments
 (0)