From 5a17de87ec2ae9dd2f9840dd5ac188630b20a675 Mon Sep 17 00:00:00 2001 From: Sean McDirmid Date: Fri, 19 Oct 2007 14:23:48 +0000 Subject: Moving my tests to pending since they won't pas... Moving my tests to pending since they won't pass unless arrays are fixed. --- src/library/scala/runtime/ScalaRunTime.scala | 1 - test/files/run/array_casts.check | 16 ----------- test/files/run/array_casts.scala | 42 ---------------------------- test/pending/run/array_casts.check | 16 +++++++++++ test/pending/run/array_casts.scala | 42 ++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 59 deletions(-) delete mode 100644 test/files/run/array_casts.check delete mode 100644 test/files/run/array_casts.scala create mode 100644 test/pending/run/array_casts.check create mode 100644 test/pending/run/array_casts.scala diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala index 0a9ca7496d..f631a2688a 100644 --- a/src/library/scala/runtime/ScalaRunTime.scala +++ b/src/library/scala/runtime/ScalaRunTime.scala @@ -136,6 +136,5 @@ object ScalaRunTime { case x: Array[Boolean] => new BoxedBooleanArray(x) case x: Array[AnyRef] => new BoxedObjectArray(x) case x: BoxedArray => x - case null => null } } diff --git a/test/files/run/array_casts.check b/test/files/run/array_casts.check deleted file mode 100644 index f7d3e5036c..0000000000 --- a/test/files/run/array_casts.check +++ /dev/null @@ -1,16 +0,0 @@ -is object - true -is seq - true -is collection - true -is random-access-seq - true -is random-access-seq-mutable - true -not string - true -not list - true -class [I -Array(10) -Array(10) -Array(10) -Array(10) -Good, arrays are not lists -Good, arrays are not rich strings -is-seq array true -class [I diff --git a/test/files/run/array_casts.scala b/test/files/run/array_casts.scala deleted file mode 100644 index 9d298bbc2b..0000000000 --- a/test/files/run/array_casts.scala +++ /dev/null @@ -1,42 +0,0 @@ -object Test { - val a = Array(10) - def main(args : Array[String]) : Unit = { - val a = this.a : AnyRef - Console.println("is object - " + a.isInstanceOf[Object]) - Console.println("is seq - " + a.isInstanceOf[Seq[_]]) - Console.println("is collection - " + a.isInstanceOf[Collection[_]]) - Console.println("is random-access-seq - " + a.isInstanceOf[RandomAccessSeq[_]]) - Console.println("is random-access-seq-mutable - " + a.isInstanceOf[RandomAccessSeq.Mutable[_]]) - Console.println("not string - " + !a.isInstanceOf[String]) - Console.println("not list - " + !a.isInstanceOf[List[_]]) - try { - Console.println(a.asInstanceOf[Object].getClass) - } catch { case ex : ClassCastException => Console.println("Bad, arrays should be objects") } - try { - Console.println(a.asInstanceOf[Seq[_]]) - } catch { case ex : ClassCastException => Console.println("Bad, arrays should be seqs") } - try { - Console.println(a.asInstanceOf[Collection[_]]) - } catch { case ex : ClassCastException => Console.println("Bad, arrays should be collections") } - try { - Console.println(a.asInstanceOf[RandomAccessSeq[_]]) - } catch { case ex : ClassCastException => Console.println("Bad, arrays should be random access seqs") } - try { - Console.println(a.asInstanceOf[RandomAccessSeq.Mutable[_]]) - } catch { case ex : ClassCastException => Console.println("Bad, arrays should be mutable random access seqs") } - try { - Console.println("not expected: " + a.asInstanceOf[List[_]]) - } catch { case ex : ClassCastException => Console.println("Good, arrays are not lists") } - try { - Console.println("not expected: " + a.asInstanceOf[runtime.RichString]) - throw new Error("not expected") - } catch { case ex : ClassCastException => Console.println("Good, arrays are not rich strings") } - // check that arrays as seqs are still dynamically typed as arrays - val s = this.a : Seq[Int] - Console.println("is-seq array " + s.isInstanceOf[Array[Char]]) - try { - Console.println(s.asInstanceOf[Array[Int]].getClass) - } catch { case ex : ClassCastException => Console.println("Bad, arrays as seqs should still be arrays of int") } - () - } -} diff --git a/test/pending/run/array_casts.check b/test/pending/run/array_casts.check new file mode 100644 index 0000000000..f7d3e5036c --- /dev/null +++ b/test/pending/run/array_casts.check @@ -0,0 +1,16 @@ +is object - true +is seq - true +is collection - true +is random-access-seq - true +is random-access-seq-mutable - true +not string - true +not list - true +class [I +Array(10) +Array(10) +Array(10) +Array(10) +Good, arrays are not lists +Good, arrays are not rich strings +is-seq array true +class [I diff --git a/test/pending/run/array_casts.scala b/test/pending/run/array_casts.scala new file mode 100644 index 0000000000..9d298bbc2b --- /dev/null +++ b/test/pending/run/array_casts.scala @@ -0,0 +1,42 @@ +object Test { + val a = Array(10) + def main(args : Array[String]) : Unit = { + val a = this.a : AnyRef + Console.println("is object - " + a.isInstanceOf[Object]) + Console.println("is seq - " + a.isInstanceOf[Seq[_]]) + Console.println("is collection - " + a.isInstanceOf[Collection[_]]) + Console.println("is random-access-seq - " + a.isInstanceOf[RandomAccessSeq[_]]) + Console.println("is random-access-seq-mutable - " + a.isInstanceOf[RandomAccessSeq.Mutable[_]]) + Console.println("not string - " + !a.isInstanceOf[String]) + Console.println("not list - " + !a.isInstanceOf[List[_]]) + try { + Console.println(a.asInstanceOf[Object].getClass) + } catch { case ex : ClassCastException => Console.println("Bad, arrays should be objects") } + try { + Console.println(a.asInstanceOf[Seq[_]]) + } catch { case ex : ClassCastException => Console.println("Bad, arrays should be seqs") } + try { + Console.println(a.asInstanceOf[Collection[_]]) + } catch { case ex : ClassCastException => Console.println("Bad, arrays should be collections") } + try { + Console.println(a.asInstanceOf[RandomAccessSeq[_]]) + } catch { case ex : ClassCastException => Console.println("Bad, arrays should be random access seqs") } + try { + Console.println(a.asInstanceOf[RandomAccessSeq.Mutable[_]]) + } catch { case ex : ClassCastException => Console.println("Bad, arrays should be mutable random access seqs") } + try { + Console.println("not expected: " + a.asInstanceOf[List[_]]) + } catch { case ex : ClassCastException => Console.println("Good, arrays are not lists") } + try { + Console.println("not expected: " + a.asInstanceOf[runtime.RichString]) + throw new Error("not expected") + } catch { case ex : ClassCastException => Console.println("Good, arrays are not rich strings") } + // check that arrays as seqs are still dynamically typed as arrays + val s = this.a : Seq[Int] + Console.println("is-seq array " + s.isInstanceOf[Array[Char]]) + try { + Console.println(s.asInstanceOf[Array[Int]].getClass) + } catch { case ex : ClassCastException => Console.println("Bad, arrays as seqs should still be arrays of int") } + () + } +} -- cgit v1.2.3