From 9fa18ccfc0fd281ac111557fa317aef515c8a46f Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 2 Jul 2015 16:12:22 -0700 Subject: SI-9377 Update ScalaVersion error text Simplify and sweeten the message. --- test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala | 4 ++++ test/junit/scala/tools/nsc/settings/SettingsTest.scala | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'test/junit') 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:") assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource", "2.11"), _ == "-Xsource requires an argument, the syntax is -Xsource:") - 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)") } } -- cgit v1.2.3