summaryrefslogtreecommitdiff
path: root/test/junit/scala/tools/testing
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-08-25 23:13:05 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2014-09-10 00:05:03 +0200
commit44b5c261a8e585c5747380895aa06c84f9d63f6c (patch)
treebebacf259c0d62d4b9298b4892cc5c2c309cc857 /test/junit/scala/tools/testing
parentd3cfbb1db68dab3308edfa66bbdb497c5d3f0cb2 (diff)
downloadscala-44b5c261a8e585c5747380895aa06c84f9d63f6c.tar.gz
scala-44b5c261a8e585c5747380895aa06c84f9d63f6c.tar.bz2
scala-44b5c261a8e585c5747380895aa06c84f9d63f6c.zip
JUnit tests for dead code elimination.
JUnit tests may use tools from partest-extras (ASMConverters)
Diffstat (limited to 'test/junit/scala/tools/testing')
-rw-r--r--test/junit/scala/tools/testing/AssertThrowsTest.scala11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/junit/scala/tools/testing/AssertThrowsTest.scala b/test/junit/scala/tools/testing/AssertThrowsTest.scala
index a70519e63c..d91e450bac 100644
--- a/test/junit/scala/tools/testing/AssertThrowsTest.scala
+++ b/test/junit/scala/tools/testing/AssertThrowsTest.scala
@@ -31,4 +31,13 @@ class AssertThrowsTest {
}
})
-} \ No newline at end of file
+ @Test
+ def errorIfNoThrow: Unit = {
+ try {
+ assertThrows[Foo] { () }
+ } catch {
+ case e: AssertionError => return
+ }
+ assert(false, "assertThrows should error if the tested expression does not throw anything")
+ }
+}