summaryrefslogtreecommitdiff
path: root/test/files/run/t1505.scala
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-01-17 20:05:30 +0100
committerSimon Ochsenreither <simon@ochsenreither.de>2013-01-17 20:52:24 +0100
commit2ee85683cdd2f8f41508fef0880edb31c1d97a4c (patch)
treebba4b392fd016508538949978ad6cecdc9173aa9 /test/files/run/t1505.scala
parent167fc0acb9bc75f3f378d2bfbabd61a2782a3568 (diff)
downloadscala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.tar.gz
scala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.tar.bz2
scala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.zip
SI-6811 Remove deprecated constructors
Diffstat (limited to 'test/files/run/t1505.scala')
-rw-r--r--test/files/run/t1505.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/files/run/t1505.scala b/test/files/run/t1505.scala
index a246e8a35b..d7feb30ce3 100644
--- a/test/files/run/t1505.scala
+++ b/test/files/run/t1505.scala
@@ -1,5 +1,3 @@
-object P extends Enumeration(0, "A", "B", "C") { val A, B, C = Value }
-
object Q extends Enumeration {
val A = Value("A")
val B = Value("B")
@@ -11,9 +9,14 @@ object R extends Enumeration {
}
object Test extends App {
- assert(P(0) == P.withName("A"))
- assert(P.C == P.withName("C"))
-
assert(Q(0) == Q.withName("A"))
assert(Q.C == Q.withName("C"))
+
+ assert(R(0) == R.withName("A"))
+ assert(R.C == R.withName("C"))
+
+ var failed = false
+ try { Q.withName("x") } catch { case _: NoSuchElementException => failed = true }
+ assert(failed)
+
}