diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/xml03syntax.scala | 4 | ||||
-rwxr-xr-x | test/files/run/existentials.scala | 2 | ||||
-rw-r--r-- | test/files/run/iq.scala | 68 | ||||
-rwxr-xr-x | test/files/run/unboxingBug.scala | 8 |
4 files changed, 41 insertions, 41 deletions
diff --git a/test/files/jvm/xml03syntax.scala b/test/files/jvm/xml03syntax.scala index 7e49ee7b7e..2fee0243a6 100644 --- a/test/files/jvm/xml03syntax.scala +++ b/test/files/jvm/xml03syntax.scala @@ -41,9 +41,9 @@ object Test extends AnyRef with Assert { assertEquals(handle[Boolean](xd), true) - val xe = <hello>{ 5:short }</hello> + val xe = <hello>{ 5:Short }</hello> - assertEquals(handle[Short](xe), 5:short) + assertEquals(handle[Short](xe), 5:Short) val xf = <hello>{ val x = 27; x }</hello> diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala index 42711df5f2..879f445588 100755 --- a/test/files/run/existentials.scala +++ b/test/files/run/existentials.scala @@ -29,7 +29,7 @@ case class C[T](x: T) object LUB { def x = C(1) def y = C("abc") - var coinflip: boolean = _ + var coinflip: Boolean = _ def z = if (coinflip) x else y def zz: C[_1] forSome { type _1 >: Int with java.lang.String } = z def zzs: C[_ >: Int with java.lang.String] = z diff --git a/test/files/run/iq.scala b/test/files/run/iq.scala index 87bbe45cd7..b580b6b191 100644 --- a/test/files/run/iq.scala +++ b/test/files/run/iq.scala @@ -2,88 +2,89 @@ * Test file for immutable queues. */ -import scala.collection.immutable.Queue; +import scala.collection.immutable.Queue object iq { - def main = { + def main { /* Create an empty queue. */ - val q:Queue[Int] = Queue.Empty; + val q: Queue[Int] = Queue.Empty /* Test isEmpty. * Expected: Empty */ - if(q.isEmpty) { - Console.println("Empty"); + if (q.isEmpty) { + Console.println("Empty") } /* Test infix enqueing. */ - val q2 = q + 42 + 0; + //val q2 = q + 42 + 0 // deprecated + val q2 = q.enqueue(42, 0) /* Test is empty and dequeue. * Expected: Head: 42 */ val q4 = - if(q2.isEmpty) { - Console.println("Empty"); - q2; - } else { - val Pair(head,q3) = q2.dequeue; - Console.println("Head: " + head); - q3; - }; + if (q2.isEmpty) { + Console.println("Empty") + q2 + } + else { + val (head, q3) = q2.dequeue + Console.println("Head: " + head) + q3 + } /* Test sequence enqueing. */ - val q5:Queue[Any] = q4.enqueue(1,2,3,4,5,6,7,8,9); + val q5: Queue[Any] = q4.enqueue(1,2,3,4,5,6,7,8,9) /* Test toString. * Expected: Head: q5: Queue(0,1,2,3,4,5,6,7,8,9) */ - Console.println("q5: " + q5); + Console.println("q5: " + q5) /* Test apply * Expected: q5[5]: 5 */ - Console.println("q5[5]: " + q5(5)); + Console.println("q5[5]: " + q5(5)) - - - val q5c:Queue[int] = Queue.Empty.enqueue(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); + val q5c: Queue[Int] = Queue.Empty.enqueue(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); /* Testing == * Expected: q5 == q9: true * q9 == q5: true */ - Console.println("q5 == q5c: " + (q5 == q5c)); - Console.println("q5c == q5: " + (q5c == q5)); + Console.println("q5 == q5c: " + (q5 == q5c)) + Console.println("q5c == q5: " + (q5c == q5)) - val Pair(_,q6) = q5.dequeue; - val Pair(_,q7) = q6.dequeue; - val q8 = q7 + 10 + 11; + val (_, q6) = q5.dequeue + val (_, q7) = q6.dequeue + //val q8 = q7 + 10 + 11 //deprecated + val q8 = q7.enqueue(10, 11) /* Test dequeu * Expected: q8: Queue(2,3,4,5,6,7,8,9,10,11) */ - Console.println("q8: " + q8); - val q9 = new Queue(2,3,4,5,6,7,8,9,10,11); + Console.println("q8: " + q8) + val q9 = new Queue(2,3,4,5,6,7,8,9,10,11) /* Testing == * Expected: q8 == q9: true */ - Console.println("q8 == q9: " + (q8 == q9)); + Console.println("q8 == q9: " + (q8 == q9)) /* Testing elements * Expected: Elements: 1 2 3 4 5 6 7 8 9 */ Console.print("Elements: "); - q6.elements.foreach(e => Console.print(" "+ e + " ")); + q6.elements.foreach(e => Console.print(" "+ e + " ")) Console.println; /* Testing mkString * Expected: String: <1-2-3-4-5-6-7-8-9> */ - Console.println("String: " + q6.mkString("<","-",">")); + Console.println("String: " + q6.mkString("<","-",">")) /* Testing length * Expected: Length: 9 */ - Console.println("Length: " + q6.length); + Console.println("Length: " + q6.length) /* Testing front * Expected: Front: 1 @@ -93,8 +94,7 @@ object iq { } object Test { - def main(args: Array[String]): Unit = { - iq.main; - (); + def main(args: Array[String]) { + iq.main } } diff --git a/test/files/run/unboxingBug.scala b/test/files/run/unboxingBug.scala index a8485cfa9e..62c2d20202 100755 --- a/test/files/run/unboxingBug.scala +++ b/test/files/run/unboxingBug.scala @@ -1,8 +1,8 @@ object Test extends Application { println(identity('a').toInt) println('a'.toInt) - println(identity('a').asInstanceOf[int]) - println('a'.asInstanceOf[int]) - println(identity(1).asInstanceOf[int]) - println(1.asInstanceOf[int]) + println(identity('a').asInstanceOf[Int]) + println('a'.asInstanceOf[Int]) + println(identity(1).asInstanceOf[Int]) + println(1.asInstanceOf[Int]) } |