diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-08-24 10:22:20 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-09-02 11:26:05 +0200 |
commit | 0a6dd09d7585448d0c66835a2d2618eb12a47786 (patch) | |
tree | e4211ccf20e95143e684f78724c532e677f07988 /test/junit/scala/tools/nsc/symtab/StdNamesTest.scala | |
parent | fc21e3b3bef59e17b3c9aa800d9288752f41853f (diff) | |
download | scala-0a6dd09d7585448d0c66835a2d2618eb12a47786.tar.gz scala-0a6dd09d7585448d0c66835a2d2618eb12a47786.tar.bz2 scala-0a6dd09d7585448d0c66835a2d2618eb12a47786.zip |
Fix assertThrows, and the behaviors that it shadowed
The test in StdNamesTest was introduced in cff8b569, where newTermName
would throw on a negative length. In b090f97 this was changed to fix
the negative length, but the test was not adapted (as it didn't fail).
Diffstat (limited to 'test/junit/scala/tools/nsc/symtab/StdNamesTest.scala')
-rw-r--r-- | test/junit/scala/tools/nsc/symtab/StdNamesTest.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/junit/scala/tools/nsc/symtab/StdNamesTest.scala b/test/junit/scala/tools/nsc/symtab/StdNamesTest.scala index 4a39cf9d48..524d2e45e0 100644 --- a/test/junit/scala/tools/nsc/symtab/StdNamesTest.scala +++ b/test/junit/scala/tools/nsc/symtab/StdNamesTest.scala @@ -15,12 +15,16 @@ class StdNamesTest { @Test def testNewTermNameInvalid(): Unit = { - assertThrows[IllegalArgumentException](newTermName("foo".toCharArray, 0, -1)) - assertThrows[IllegalArgumentException](newTermName("foo".toCharArray, 0, 0)) assertThrows[IllegalArgumentException](newTermName("foo".toCharArray, -1, 1)) } @Test + def testNewTermNameNegativeLenght(): Unit = { + assertEquals(nme.EMPTY, newTermName("foo".toCharArray, 0, -1)) + assertEquals(nme.EMPTY, newTermName("foo".toCharArray, 0, 0)) + } + + @Test def testUnspecializedName(): Unit = { def test(expected: Name, nme: Name) { assertEquals(expected, unspecializedName(nme)) |