Skip to content

Commit

Permalink
[WIP] Add BashExitCode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed May 2, 2024
1 parent 4a35fa8 commit 95a664f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/test/dotty/tools/scripting/BashExitCodeTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ class BashExitCodeTests:
@Test def runNeg = scala(f("@main def Test = prin", ".sc"))(1)
@Test def runRun = scala(f("@main def Test = ???", ".sc"))(1)
@Test def runPos = scala(f("@main def Test = ()", ".sc"))(0)
@Test def runPos2 = scala(f("@main def Foo = ()", ".sc"))(0)
@Test def runPos3 = scala(f("@main def test = ()", ".sc"))(0)
@Test def runPos4 = scala(f("object Test { def main(args: Array[String]) = () }", ".sc"))(0)

@Test def scNeg = scalac("-script", f("@main def Test = prin", ".sc"))(1)
@Test def scRun = scalac("-script", f("@main def Test = ???", ".sc"))(1)
@Test def scPos = scalac("-script", f("@main def Test = ()", ".sc"))(0)
@Test def scPos2 = scalac("-script", f("@main def Foo = ()", ".sc"))(0)
@Test def scPos3 = scalac("-script", f("@main def test = ()", ".sc"))(0)
@Test def scPos4 = scalac("-script", f("object Test { def main(args: Array[String]) = () }", ".sc"))(0)

@Test def evalNeg = scala("-e", "'prinln(10*10)'")(1)
@Test def evalRun = scala("-e", "'1/0'")(1)
Expand Down

0 comments on commit 95a664f

Please sign in to comment.