summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2015-07-02 16:12:22 -0700
committerSom Snytt <som.snytt@gmail.com>2015-07-02 18:23:38 -0700
commit9fa18ccfc0fd281ac111557fa317aef515c8a46f (patch)
tree85180ee04e5b6f0e0eca2d3a8d6d3dab1add59e2 /test/junit
parentf187bde1fde0e48960b39242db0d42573f1e363b (diff)
downloadscala-9fa18ccfc0fd281ac111557fa317aef515c8a46f.tar.gz
scala-9fa18ccfc0fd281ac111557fa317aef515c8a46f.tar.bz2
scala-9fa18ccfc0fd281ac111557fa317aef515c8a46f.zip
SI-9377 Update ScalaVersion error text
Simplify and sweeten the message.
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala4
-rw-r--r--test/junit/scala/tools/nsc/settings/SettingsTest.scala2
2 files changed, 5 insertions, 1 deletions
diff --git a/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala b/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
index a10e395011..3717f80362 100644
--- a/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
+++ b/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
@@ -56,6 +56,10 @@ class ScalaVersionTest {
assertThrows[NumberFormatException] { ScalaVersion("2-") }
assertThrows[NumberFormatException] { ScalaVersion("2-.") } // scalacheck territory
assertThrows[NumberFormatException] { ScalaVersion("any.7") }
+
+ assertThrows[NumberFormatException] ( ScalaVersion("2.11-ok"), _ ==
+ "Bad version (2.11-ok) not major[.minor[.revision[-suffix]]]" )
+
}
// SI-9377
diff --git a/test/junit/scala/tools/nsc/settings/SettingsTest.scala b/test/junit/scala/tools/nsc/settings/SettingsTest.scala
index 96f83c4c2f..1a2d695d68 100644
--- a/test/junit/scala/tools/nsc/settings/SettingsTest.scala
+++ b/test/junit/scala/tools/nsc/settings/SettingsTest.scala
@@ -178,6 +178,6 @@ class SettingsTest {
check(expected = "2.12", "-Xsource:2.12")
assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource"), _ == "-Xsource requires an argument, the syntax is -Xsource:<version>")
assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource", "2.11"), _ == "-Xsource requires an argument, the syntax is -Xsource:<version>")
- assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource:2.invalid"), _ contains "There was a problem parsing 2.invalid")
+ assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource:2.invalid"), _ contains "Bad version (2.invalid)")
}
}