@@ -24,11 +24,9 @@ class VulpixUnitTests extends ParallelTesting {
24
24
@ Test def missingFile : Unit =
25
25
try {
26
26
compileFile(" tests/vulpix-tests/unit/i-dont-exist.scala" , defaultOptions).expectFailure.checkExpectedErrors()
27
- fail(" didn't fail properly" )
28
- }
29
- catch {
27
+ throw new Exception (" didn't fail properly" )
28
+ } catch {
30
29
case _ : IllegalArgumentException => // pass!
31
- case NonFatal (_) => fail(" wrong exception thrown" )
32
30
}
33
31
34
32
@ Test def pos1Error : Unit =
@@ -77,18 +75,20 @@ class VulpixUnitTests extends ParallelTesting {
77
75
compileFile(" tests/vulpix-tests/unit/deadlock.scala" , defaultOptions).expectFailure.checkRuns()
78
76
79
77
@ Test def badJava : Unit =
80
- try compileFile(" tests/vulpix-tests/unit/BadJava.java" , defaultOptions).suppressAllOutput.checkCompile()
81
- catch {
82
- case ae : AssertionError => assert(ae.getMessage.contains(" java compilation failed" ))
78
+ try {
79
+ compileFile(" tests/vulpix-tests/unit/BadJava.java" , defaultOptions).suppressAllOutput.checkCompile()
80
+ throw new Exception (" didn't fail properly" )
81
+ } catch {
82
+ case ae : AssertionError => assertTrue(ae.getMessage.contains(" java compilation failed" ))
83
83
}
84
84
85
85
@ Test def runTimeout : Unit = {
86
86
try {
87
87
compileFile(" tests/vulpix-tests/unit/timeout.scala" , defaultOptions).checkRuns()
88
- assert( false , " unreachable " )
88
+ throw new Exception ( " didn't fail properly " )
89
89
} catch {
90
90
case ae : AssertionError =>
91
- assert (ae.getMessage == " Run test failed, but should not, reasons:\n - test 'tests/vulpix-tests/unit/timeout.scala' timed out" )
91
+ assertEquals (ae.getMessage, " Run test failed, but should not, reasons:\n - test 'tests/vulpix-tests/unit/timeout.scala' timed out" )
92
92
}
93
93
}
94
94
}
0 commit comments