@@ -515,13 +515,19 @@ class SipScalaTests extends ScalaCliSuite with SbtTestHelper with MillTestHelper
515
515
}
516
516
}
517
517
518
- test(" consecutive -Wconf:* flags are not ignored" ) {
518
+ for {
519
+ useDirective <- Seq (true , false )
520
+ if ! Properties .isWin
521
+ optionsSource = if (useDirective) " using directive" else " command line"
522
+ } test(s " consecutive -Wconf:* flags are not ignored (passed via $optionsSource) " ) {
519
523
val sv = " 3.5.2"
520
524
val sourceFileName = " example.scala"
521
525
val warningConfOptions = Seq (" -Wconf:cat=deprecation:e" , " -Wconf:any:s" )
526
+ val maybeDirectiveString =
527
+ if (useDirective) s " //> using options ${warningConfOptions.mkString(" " )}" else " "
522
528
TestInputs (os.rel / sourceFileName ->
523
529
s """ //> using scala $sv
524
- |//> using options ${warningConfOptions.mkString( " " )}
530
+ | $maybeDirectiveString
525
531
|object WConfExample extends App {
526
532
| @deprecated("This method will be removed", "1.0.0")
527
533
| def oldMethod(): Unit = println("This is an old method.")
@@ -539,12 +545,19 @@ class SipScalaTests extends ScalaCliSuite with SbtTestHelper with MillTestHelper
539
545
localBin,
540
546
s " scalac: $sv"
541
547
).call(cwd = root)
542
- val cliRes = os.proc(TestUtil .cli, " compile" , sourceFileName, " --server=false" )
543
- .call(cwd = root, check = false , stderr = os.Pipe )
548
+ val cliRes =
549
+ os.proc(
550
+ TestUtil .cli,
551
+ " compile" ,
552
+ sourceFileName,
553
+ " --server=false" ,
554
+ if (useDirective) Nil else warningConfOptions
555
+ )
556
+ .call(cwd = root, check = false , stderr = os.Pipe )
544
557
val scalacRes = os.proc(localBin / " scalac" , warningConfOptions, sourceFileName)
545
558
.call(cwd = root, check = false , stderr = os.Pipe )
546
559
expect(scalacRes.exitCode == cliRes.exitCode)
547
- expect(scalacRes .err.trim() == cliRes .err.trim())
560
+ expect(cliRes .err.trim() == scalacRes .err.trim())
548
561
}
549
562
}
550
563
0 commit comments