diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-01-17 20:05:30 +0100 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-01-17 20:52:24 +0100 |
commit | 2ee85683cdd2f8f41508fef0880edb31c1d97a4c (patch) | |
tree | bba4b392fd016508538949978ad6cecdc9173aa9 /test | |
parent | 167fc0acb9bc75f3f378d2bfbabd61a2782a3568 (diff) | |
download | scala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.tar.gz scala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.tar.bz2 scala-2ee85683cdd2f8f41508fef0880edb31c1d97a4c.zip |
SI-6811 Remove deprecated constructors
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t342.scala | 8 | ||||
-rw-r--r-- | test/files/run/enums.scala | 14 | ||||
-rw-r--r-- | test/files/run/t1505.scala | 13 |
3 files changed, 18 insertions, 17 deletions
diff --git a/test/files/pos/t342.scala b/test/files/pos/t342.scala deleted file mode 100644 index 752b24d2ba..0000000000 --- a/test/files/pos/t342.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Main extends App { - - object Foo extends Enumeration(0, "Bar") { // 2 - val Bar = Value - } - import Foo._; - Console.println(Bar) -} diff --git a/test/files/run/enums.scala b/test/files/run/enums.scala index 9cdeed2691..3aad7ec320 100644 --- a/test/files/run/enums.scala +++ b/test/files/run/enums.scala @@ -36,8 +36,11 @@ object Test2 { object Test3 { - object Direction extends Enumeration("North", "South", "East", "West") { - val North, South, East, West = Value; + object Direction extends Enumeration { + val North = Value("North") + val South = Value("South") + val East = Value("East") + val West = Value("West") } def run: Int = { @@ -48,8 +51,11 @@ object Test3 { object Test4 { - object Direction extends Enumeration("North", "South", "East", "West") { - val North, South, East, West = Value; + object Direction extends Enumeration { + val North = Value("North") + val South = Value("South") + val East = Value("East") + val West = Value("West") } def run: Int = { 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) + } |