@@ -535,10 +535,22 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
535
535
""" //> using dep "com.lihaoyi::os-lib:0.9.1"
536
536
|//> using object.wrapper
537
537
|@main def main(args: String*): Unit = println("Hello")
538
- |""" .stripMargin
538
+ |""" .stripMargin,
539
+ os.rel / " munit.sc" ->
540
+ """ //> using scala "3.2.2"
541
+ |//> using dep "org.scalatest::scalatest:3.2.15"
542
+ |
543
+ |import org.scalatest.*, flatspec.*, matchers.*
544
+ |
545
+ |class PiTest extends AnyFlatSpec with should.Matchers {
546
+ | "pi calculus" should "return a precise enough pi value" in {
547
+ | math.Pi shouldBe 3.14158d +- 0.001d
548
+ | }
549
+ |}
550
+ |org.scalatest.tools.Runner.main(Array("-oDF", "-s", classOf[PiTest].getName))""" .stripMargin
539
551
)
540
552
inputs.fromRoot { root =>
541
- val res = os.proc(TestUtil .cli, " --power" , " script.sc" , " --object-wrapper" )
553
+ val res = os.proc(TestUtil .cli, " --power" , " script.sc" , " munit.sc " , " --object-wrapper" )
542
554
.call(cwd = root, mergeErrIntoOut = true , stdout = os.Pipe )
543
555
544
556
val outputNormalized : String = normalizeConsoleOutput(res.out.text())
@@ -547,7 +559,7 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
547
559
" [warn] Annotation @main in .sc scripts is not supported, it will be ignored, use .scala format instead"
548
560
))
549
561
550
- val directiveRes = os.proc(TestUtil .cli, " --power" , " script-with-directive.sc" )
562
+ val directiveRes = os.proc(TestUtil .cli, " --power" , " script-with-directive.sc" , " munit.sc " )
551
563
.call(cwd = root, mergeErrIntoOut = true , stdout = os.Pipe )
552
564
553
565
val directiveOutputNormalized : String = normalizeConsoleOutput(directiveRes.out.text())
0 commit comments