diff options
Diffstat (limited to 'tests/pending/run/lift-and-unlift.scala')
-rw-r--r-- | tests/pending/run/lift-and-unlift.scala | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/pending/run/lift-and-unlift.scala b/tests/pending/run/lift-and-unlift.scala deleted file mode 100644 index 9cd85666e..000000000 --- a/tests/pending/run/lift-and-unlift.scala +++ /dev/null @@ -1,27 +0,0 @@ -import Function.unlift - -object Test { - def evens1(x: Int) = if (x % 2 == 0) Some(x) else None - val evens2: PartialFunction[Int, Int] = { - case x if x % 2 == 0 => x - } - - def main(args: Array[String]): Unit = { - val f1 = evens1 _ - val f2 = evens2.lift - - assert(1 to 10 forall (x => f1(x) == f2(x))) - - val f3 = unlift(f1) - val f4 = unlift(f2) - - assert(1 to 10 forall { x => - if (!f3.isDefinedAt(x)) !f4.isDefinedAt(x) - else f3(x) == f4(x) - }) - - assert(f1 eq f3.lift) - assert(f4 eq unlift(f2)) - assert(f4 eq evens2) - } -} |