diff options
Diffstat (limited to 'test')
95 files changed, 505 insertions, 104 deletions
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala new file mode 100644 index 0000000000..0875d9160c --- /dev/null +++ b/test/files/jvm/innerClassAttribute/Classes_1.scala @@ -0,0 +1,99 @@ +class A1 { + class B +} + +class A2 { + object B +} + +object A3 { + class B1 + object B2 +} + +class A4 { + def f(l: List[Int]): List[Int] = { + l map (_ + 1) + } +} + +class A5 { + def f(): Object = { + object B + B + } +} + +trait A6 { + def hui = -6 + trait TT +} + +class A7 extends A6 + +abstract class A8 extends A6 { + def fish: TT +} + +class A9 { + class brick extends annotation.StaticAnnotation +} + +class A10 { + val a9 = new A9() + // there's no reference to brick in the bytecode (only in the pickle), so there's no InnerClass attribute for it. + @a9.brick def f = -7 +} + +class A11 { + @JavaAnnot_1.Ann def f = -8 +} + +object A12 { + object B { + class C + } +} + +class A13 { + def oak: A12.B.C = new A12.B.C +} + +class A14 { + def f = { + val x: Object = { + class K + new K + } + x + } + def g = { + val x: Object = new A6 { } + } +} + +object A15 { + def f = { + class B { // static (does not have an outer pointer) + class C // non-static + } + } +} + +class A16 { + val x: A6 = { + class U extends A6 + new A6 { } + } + + { + class V extends A6 + new A6 { } + } +} + +class A17 { + object B { + class C // not static, has an outer pointer. + } +} diff --git a/test/files/jvm/innerClassAttribute/JavaAnnot_1.java b/test/files/jvm/innerClassAttribute/JavaAnnot_1.java new file mode 100644 index 0000000000..27c4d4e5d3 --- /dev/null +++ b/test/files/jvm/innerClassAttribute/JavaAnnot_1.java @@ -0,0 +1,3 @@ +public class JavaAnnot_1 { + public static @interface Ann {} +} diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala new file mode 100644 index 0000000000..6cf60ab92d --- /dev/null +++ b/test/files/jvm/innerClassAttribute/Test.scala @@ -0,0 +1,208 @@ +import scala.tools.partest.BytecodeTest +import scala.tools.asm +import asm.tree.{ClassNode, InnerClassNode} +import asm.{Opcodes => Flags} +import scala.collection.JavaConverters._ + +object Test extends BytecodeTest { + def assertSame(a: Any, b: Any) = { + assert(a == b, s"\na: $a\nb: $b") + } + + val publicStatic = Flags.ACC_PUBLIC | Flags.ACC_STATIC + val publicAbstractInterface = Flags.ACC_PUBLIC | Flags.ACC_ABSTRACT | Flags.ACC_INTERFACE + + def innerClassNodes(className: String): List[InnerClassNode] = { + loadClassNode(className).innerClasses.asScala.toList.sortBy(_.name) + } + + final case class EnclosingMethod(name: String, descriptor: String, outerClass: String) + def enclosingMethod(className: String) = { + val n = loadClassNode(className) + EnclosingMethod(n.outerMethod, n.outerMethodDesc, n.outerClass) + } + + def assertMember(node: InnerClassNode, outer: String, inner: String, name: Option[String] = None, flags: Int = Flags.ACC_PUBLIC) = { + assertSame(node.name, name.getOrElse(s"$outer$$$inner")) + assertSame(node.outerName, outer) + assertSame(node.innerName, inner) + assertSame(node.access, flags) + } + + def assertAnonymous(node: InnerClassNode, name: String, flags: Int = Flags.ACC_PUBLIC | Flags.ACC_FINAL) = { + assertSame(node.name, name) + assertSame(node.outerName, null) + assertSame(node.innerName, null) + assertSame(node.access, flags) + } + + def assertLocal(node: InnerClassNode, name: String, inner: String, flags: Int = Flags.ACC_PUBLIC) = { + assertSame(node.name, name) + assertSame(node.outerName, null) + assertSame(node.innerName, inner) + assertSame(node.access, flags) + } + + def assertEnclosingMethod(enclosingMethod: EnclosingMethod, outerClass: String, name: String, descriptor: String) = { + assertSame(enclosingMethod.outerClass, outerClass) + assertSame(enclosingMethod.name, name) + assertSame(enclosingMethod.descriptor, descriptor) + } + + def testA1() = { + val List(b1) = innerClassNodes("A1") + assertMember(b1, "A1", "B") + val List(b2) = innerClassNodes("A1$B") + assertMember(b2, "A1", "B") + } + + def testA2() = { + val List(b1) = innerClassNodes("A2") + assertMember(b1, "A2", "B$") + val List(b2) = innerClassNodes("A2$B$") + assertMember(b2, "A2", "B$") + } + + def testA3() = { + def t(c: String) = { + val List(b1, b2) = innerClassNodes(c) + // the outer class for classes nested inside top-level modules is not the module class, but the mirror class. + // this is a hack for java interop, handled in the backend. see BTypes.scala, comment on "Java Compatibility". + assertMember(b1, "A3", "B1", flags = publicStatic) + assertMember(b2, "A3", "B2$", flags = publicStatic) + } + t("A3$") + // the mirror class has the same inner class attributes as the module + // class (added when the mirror is created in the backend) + t("A3") + } + + def testA4() = { + val List(an1) = innerClassNodes("A4") + assertAnonymous(an1, "A4$$anonfun$f$1") + val List(an2) = innerClassNodes("A4$$anonfun$f$1") + assertAnonymous(an2, "A4$$anonfun$f$1") + assertEnclosingMethod( + enclosingMethod("A4$$anonfun$f$1"), + "A4", "f", "(Lscala/collection/immutable/List;)Lscala/collection/immutable/List;") + } + + def testA5() = { + val List(b1) = innerClassNodes("A5") + assertLocal(b1, "A5$B$2$", "B$2$") + val List(b2) = innerClassNodes("A5$B$2$") + assertLocal(b2, "A5$B$2$", "B$2$") + assertEnclosingMethod( + enclosingMethod("A5$B$2$"), + "A5", "f", "()Ljava/lang/Object;") + } + + def testA6() = { + val List(tt1) = innerClassNodes("A6") + assertMember(tt1, "A6", "TT", flags = publicAbstractInterface) + val List() = innerClassNodes("A6$class") + val List(tt2) = innerClassNodes("A6$TT") + assertMember(tt2, "A6", "TT", flags = publicAbstractInterface) + } + + def testA7() = { + val List() = innerClassNodes("A7") + } + + def testA8() = { + val List(tt) = innerClassNodes("A8") + assertMember(tt, "A6", "TT", flags = publicAbstractInterface) + } + + def testA10() = { + val List() = innerClassNodes("A10") + } + + def testA11() = { + val List(ann) = innerClassNodes("A11") + // in the java class file, the INNERCLASS attribute has more flags (public | static | abstract | interface | annotation) + // the scala compiler has its own interpretation of java annotations ant their flags.. it only emits publicStatic. + assertMember(ann, "JavaAnnot_1", "Ann", flags = publicStatic) + } + + def testA13() = { + val List(b, c) = innerClassNodes("A13") + assertMember(b, "A12", "B$", flags = publicStatic) + assertMember(c, "A12$B$", "C", name = Some("A12$B$C"), flags = publicStatic) + } + + def testA14() = { + val List(anon, k) = innerClassNodes("A14") + + assertLocal(k, "A14$K$1", "K$1") + assertEnclosingMethod( + enclosingMethod("A14$K$1"), + "A14", "f", "()Ljava/lang/Object;") + + assertAnonymous(anon, "A14$$anon$1") + assertEnclosingMethod( + enclosingMethod("A14$$anon$1"), + "A14", "g", "()V") + } + + def testA15() = { + val List(b) = innerClassNodes("A15") + assertLocal(b, "A15$B$3", "B$3", flags = publicStatic) + + val List(_, c) = innerClassNodes("A15$B$3") + // TODO this is a bug in the backend, C should be a member. Instead, its outerClass is null + // assertMember(c, "A15$B$3", "C") + assertLocal(c, "A15$B$3$C", "C") + } + + def testA16() = { + val List(anon1, anon2, u, v) = innerClassNodes("A16") + // TODO there's a bug in the backend: anon$2 has outerClass A16, but anonymous classes should have outerClass null + // assertAnonymous(anon1, "A16$$anon$2") + assertMember(anon1, "A16", null, name = Some("A16$$anon$2"), flags = Flags.ACC_PUBLIC | Flags.ACC_FINAL) + assertAnonymous(anon2, "A16$$anon$3") + // TODO this is a bug in the backend, U should not be a member, its outerClass should be null + // assertLocal(u, "A16$U$1", "U$1") + assertMember(u, "A16", "U$1") + assertLocal(v, "A16$V$1", "V$1") + + assertEnclosingMethod( + enclosingMethod("A16$$anon$2"), + "A16", "<init>", "()V") + assertEnclosingMethod( + enclosingMethod("A16$$anon$3"), + "A16", "<init>", "()V") + // TODO this is a bug, there should be an enclosingMethod attribute in U + // assertEnclosingMethod( + // enclosingMethod("A16$U$1"), + // "A16", "<init>", "()V") + assertEnclosingMethod( + enclosingMethod("A16$V$1"), + "A16", "<init>", "()V") + } + + def testA17() = { + val List(b, c) = innerClassNodes("A17$B$") + assertMember(b, "A17", "B$") + // TODO this is a bug, should not be static. + assertMember(c, "A17$B$", "C", name = Some("A17$B$C"), flags = publicStatic) // (should be) not static, has an outer pointer. + } + + def show(): Unit = { + testA1() + testA2() + testA3() + testA4() + testA5() + testA6() + testA7() + testA8() + testA10() + testA11() + testA13() + testA14() + testA15() + testA16() + testA17() + } +} diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check index d124794e72..d03edb638c 100644 --- a/test/files/jvm/interpreter.check +++ b/test/files/jvm/interpreter.check @@ -361,7 +361,7 @@ It would fail on the following inputs: Exp(), Term() ^ f: (e: Exp)Int -scala> +scala> :quit plusOne: (x: Int)Int res0: Int = 6 res0: String = after reset diff --git a/test/files/jvm/throws-annot-from-java.check b/test/files/jvm/throws-annot-from-java.check index be3ba412f8..c541b26fcc 100644 --- a/test/files/jvm/throws-annot-from-java.check +++ b/test/files/jvm/throws-annot-from-java.check @@ -44,4 +44,4 @@ bar tp.typeParams.isEmpty: true throws[test.PolymorphicException[_]](classOf[test.PolymorphicException]) -scala> +scala> :quit diff --git a/test/files/jvm/xml05.check b/test/files/jvm/xml05.check index 92ea995350..cad907525d 100644 --- a/test/files/jvm/xml05.check +++ b/test/files/jvm/xml05.check @@ -4,4 +4,4 @@ Type :help for more information. scala> <city name="San José"/> res0: scala.xml.Elem = <city name="San José"/> -scala> +scala> :quit diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check index 61df5131cc..54743d4936 100644 --- a/test/files/neg/macro-basic-mamdmi.check +++ b/test/files/neg/macro-basic-mamdmi.check @@ -1,5 +1,13 @@ +Impls_Macros_Test_1.scala:33: error: macro implementation not found: foo +(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) + ^ +Impls_Macros_Test_1.scala:33: error: macro implementation not found: bar +(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) + ^ Impls_Macros_Test_1.scala:33: error: macro implementation not found: quux (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(2) + Macros.bar(2) * new Macros().quux(4)) ^ -one error found +three errors found diff --git a/test/files/neg/t3909.check b/test/files/neg/t3909.check index 7da0195607..052b49f855 100644 --- a/test/files/neg/t3909.check +++ b/test/files/neg/t3909.check @@ -1,4 +1,5 @@ t3909.scala:1: error: in object DO, multiple overloaded alternatives of m1 define default arguments +Error occurred in an application involving default arguments. object DO { ^ one error found diff --git a/test/files/neg/t7848-interp-warn.flags b/test/files/neg/t7848-interp-warn.flags index 7949c2afa2..b0d7bc25cb 100644 --- a/test/files/neg/t7848-interp-warn.flags +++ b/test/files/neg/t7848-interp-warn.flags @@ -1 +1 @@ --Xlint -Xfatal-warnings +-Xlint:missing-interpolator -Xfatal-warnings diff --git a/test/files/neg/t8266-invalid-interp.check b/test/files/neg/t8266-invalid-interp.check index 70dd4081b0..bb2d44a80c 100644 --- a/test/files/neg/t8266-invalid-interp.check +++ b/test/files/neg/t8266-invalid-interp.check @@ -1,10 +1,10 @@ t8266-invalid-interp.scala:4: error: Trailing '\' escapes nothing. f"a\", ^ -t8266-invalid-interp.scala:5: error: invalid escape character at index 1 in "a\xc" +t8266-invalid-interp.scala:5: error: invalid escape '\x' not one of [\b, \t, \n, \f, \r, \\, \", \'] at index 1 in "a\xc". Use \\ for literal \. f"a\xc", ^ -t8266-invalid-interp.scala:7: error: invalid escape character at index 1 in "a\vc" +t8266-invalid-interp.scala:7: error: invalid escape '\v' not one of [\b, \t, \n, \f, \r, \\, \", \'] at index 1 in "a\vc". Use \\ for literal \. f"a\vc" ^ three errors found diff --git a/test/files/pos/t8013.flags b/test/files/pos/t8013.flags index 954eaba352..3955bb6710 100644 --- a/test/files/pos/t8013.flags +++ b/test/files/pos/t8013.flags @@ -1 +1 @@ --Xfatal-warnings -Xlint +-Xfatal-warnings -Xlint:-infer-any,_ diff --git a/test/files/pos/t8781/Macro_1.scala b/test/files/pos/t8781/Macro_1.scala new file mode 100644 index 0000000000..ecd9c5e8d5 --- /dev/null +++ b/test/files/pos/t8781/Macro_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + val name = TypeName(c.freshName()) + q"class $name extends T; new $name" + } + def fresh: Any = macro impl +} + +trait T diff --git a/test/files/pos/t8781/Test_2.flags b/test/files/pos/t8781/Test_2.flags new file mode 100644 index 0000000000..24e2109690 --- /dev/null +++ b/test/files/pos/t8781/Test_2.flags @@ -0,0 +1 @@ +-Ymacro-expand:discard -Ystop-after:typer diff --git a/test/files/pos/t8781/Test_2.scala b/test/files/pos/t8781/Test_2.scala new file mode 100644 index 0000000000..3ca6406599 --- /dev/null +++ b/test/files/pos/t8781/Test_2.scala @@ -0,0 +1,5 @@ +object Test { + implicit class RichT(t: T) { def augmented = "" } + + Macros.fresh.augmented +} diff --git a/test/files/pos/t8793.scala b/test/files/pos/t8793.scala new file mode 100644 index 0000000000..1276155675 --- /dev/null +++ b/test/files/pos/t8793.scala @@ -0,0 +1,15 @@ +package regr + +trait F[A] + +class G(val a: F[_], val b: F[_]) + +object G { + def unapply(g: G) = Option((g.a, g.b)) +} + +object H { + def unapply(g: G) = g match { + case G(a, _) => Option(a) + } +} diff --git a/test/files/run/class-symbol-contravariant.check b/test/files/run/class-symbol-contravariant.check index 987f215bca..cbb90b52c2 100644 --- a/test/files/run/class-symbol-contravariant.check +++ b/test/files/run/class-symbol-contravariant.check @@ -33,4 +33,4 @@ res2: Boolean = true scala> sym.isContravariant // was true res3: Boolean = false -scala> +scala> :quit diff --git a/test/files/run/constant-type.check b/test/files/run/constant-type.check index 77bdf618e6..a7ba5a46c2 100644 --- a/test/files/run/constant-type.check +++ b/test/files/run/constant-type.check @@ -23,4 +23,4 @@ Class[String](classOf[java.lang.String]) scala> { ConstantType(Constant(s)); exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))); } Class(classOf[java.lang.String]) -scala> +scala> :quit diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check index a3cd59b9fb..89a08d5ccb 100644 --- a/test/files/run/constrained-types.check +++ b/test/files/run/constrained-types.check @@ -148,4 +148,4 @@ scala> val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message ^ -scala> +scala> :quit diff --git a/test/files/run/kind-repl-command.check b/test/files/run/kind-repl-command.check index 1c292572e6..586b2710e1 100644 --- a/test/files/run/kind-repl-command.check +++ b/test/files/run/kind-repl-command.check @@ -25,4 +25,4 @@ scala> :k Nonexisting Nonexisting ^ -scala> +scala> :quit diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check index f76579412e..70734966f0 100644 --- a/test/files/run/lub-visibility.check +++ b/test/files/run/lub-visibility.check @@ -8,4 +8,4 @@ scala> // but reverted that for SI-5534. scala> val x = List(List(), Vector()) x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable] = List(List(), Vector()) -scala> +scala> :quit diff --git a/test/files/run/macro-bundle-repl.check b/test/files/run/macro-bundle-repl.check index 4a0b421606..75c5c2adda 100644 --- a/test/files/run/macro-bundle-repl.check +++ b/test/files/run/macro-bundle-repl.check @@ -21,4 +21,4 @@ defined term macro foo: Unit scala> foo -scala> +scala> :quit diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check index 86b4d472ed..fab03d1558 100644 --- a/test/files/run/macro-repl-basic.check +++ b/test/files/run/macro-repl-basic.check @@ -49,4 +49,4 @@ import Macros.Shmacros._ scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4)) 31 -scala> +scala> :quit diff --git a/test/files/run/macro-repl-dontexpand.check b/test/files/run/macro-repl-dontexpand.check index 20d3b2d702..6ecc9245fa 100644 --- a/test/files/run/macro-repl-dontexpand.check +++ b/test/files/run/macro-repl-dontexpand.check @@ -13,4 +13,4 @@ bar2: (c: scala.reflect.macros.whitebox.Context)Nothing scala> def foo2 = macro bar2 defined term macro foo2: Nothing -scala> +scala> :quit diff --git a/test/files/run/macro-system-properties.check b/test/files/run/macro-system-properties.check index ffbd5a8aa8..e2e2bd32b9 100644 --- a/test/files/run/macro-system-properties.check +++ b/test/files/run/macro-system-properties.check @@ -19,4 +19,4 @@ defined object Test scala> object Test { class C(implicit a: Any) { GrabContext.grab } } defined object Test -scala> +scala> :quit diff --git a/test/files/run/private-override.check b/test/files/run/private-override.check deleted file mode 100644 index 00750edc07..0000000000 --- a/test/files/run/private-override.check +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/test/files/run/reflection-equality.check b/test/files/run/reflection-equality.check index 682326bc18..d60d861a90 100644 --- a/test/files/run/reflection-equality.check +++ b/test/files/run/reflection-equality.check @@ -48,4 +48,4 @@ res2: Boolean = true scala> t2 <:< t1 res3: Boolean = true -scala> +scala> :quit diff --git a/test/files/run/reflection-magicsymbols-repl.check b/test/files/run/reflection-magicsymbols-repl.check index 72aef1d3be..ca8857ada4 100644 --- a/test/files/run/reflection-magicsymbols-repl.check +++ b/test/files/run/reflection-magicsymbols-repl.check @@ -34,4 +34,4 @@ scala.Null scala.Nothing scala.Singleton -scala> +scala> :quit diff --git a/test/files/run/reflection-repl-classes.check b/test/files/run/reflection-repl-classes.check index 03a6aef2b5..5ebf993a87 100644 --- a/test/files/run/reflection-repl-classes.check +++ b/test/files/run/reflection-repl-classes.check @@ -30,4 +30,4 @@ scala> scala> mm(new A) res0: Any = 1 -scala> +scala> :quit diff --git a/test/files/run/reflection-repl-elementary.check b/test/files/run/reflection-repl-elementary.check index 4a223e8a24..e948c9fd61 100644 --- a/test/files/run/reflection-repl-elementary.check +++ b/test/files/run/reflection-repl-elementary.check @@ -4,4 +4,4 @@ Type :help for more information. scala> scala.reflect.runtime.universe.typeOf[List[Nothing]] res0: reflect.runtime.universe.Type = scala.List[Nothing] -scala> +scala> :quit diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check index 29ccee3cc6..c9e69744d6 100644 --- a/test/files/run/reify-repl-fail-gracefully.check +++ b/test/files/run/reify-repl-fail-gracefully.check @@ -14,4 +14,4 @@ scala> reify reify ^ -scala> +scala> :quit diff --git a/test/files/run/reify_newimpl_22.check b/test/files/run/reify_newimpl_22.check index 1432d10127..952f384a1c 100644 --- a/test/files/run/reify_newimpl_22.check +++ b/test/files/run/reify_newimpl_22.check @@ -22,4 +22,4 @@ scala> { ^ 2 -scala> +scala> :quit diff --git a/test/files/run/reify_newimpl_23.check b/test/files/run/reify_newimpl_23.check index 217f0a98c7..b7e9bfdfbc 100644 --- a/test/files/run/reify_newimpl_23.check +++ b/test/files/run/reify_newimpl_23.check @@ -21,4 +21,4 @@ scala> def foo[T]{ ^ foo: [T]=> Unit -scala> +scala> :quit diff --git a/test/files/run/reify_newimpl_25.check b/test/files/run/reify_newimpl_25.check index 93ad69defa..4f36ba10ee 100644 --- a/test/files/run/reify_newimpl_25.check +++ b/test/files/run/reify_newimpl_25.check @@ -12,4 +12,4 @@ scala> { ^ TypeTag[x.type] -scala> +scala> :quit diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check index 8e0ad87bf2..681b862795 100644 --- a/test/files/run/reify_newimpl_26.check +++ b/test/files/run/reify_newimpl_26.check @@ -14,4 +14,4 @@ foo: [T]=> Unit scala> foo[Int] WeakTypeTag[scala.List[T]] -scala> +scala> :quit diff --git a/test/files/run/reify_newimpl_35.check b/test/files/run/reify_newimpl_35.check index f884d2c0d0..bd9b3a2fb1 100644 --- a/test/files/run/reify_newimpl_35.check +++ b/test/files/run/reify_newimpl_35.check @@ -10,4 +10,4 @@ foo: [T](implicit evidence$1: reflect.runtime.universe.TypeTag[T])reflect.runtim scala> println(foo) Expr[List[Nothing]](Nil) -scala> +scala> :quit diff --git a/test/files/run/repl-assign.check b/test/files/run/repl-assign.check index bdc7793c37..faa8a93244 100644 --- a/test/files/run/repl-assign.check +++ b/test/files/run/repl-assign.check @@ -13,4 +13,4 @@ x: Int = 12 scala> y = 13 y: Int = 13 -scala> +scala> :quit diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check index 97ae208ff4..07cf23412f 100644 --- a/test/files/run/repl-bare-expr.check +++ b/test/files/run/repl-bare-expr.check @@ -47,4 +47,4 @@ Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo) scala> Bovine.x res4: List[Any] = List(Ruminant(5), Cow, Moooooo) -scala> +scala> :quit diff --git a/test/files/run/repl-colon-type.check b/test/files/run/repl-colon-type.check index 1f6d3e2b39..9898027c1d 100644 --- a/test/files/run/repl-colon-type.check +++ b/test/files/run/repl-colon-type.check @@ -218,4 +218,4 @@ Unit scala> :type println("side effect!") Unit -scala> +scala> :quit diff --git a/test/files/run/repl-empty-package.check b/test/files/run/repl-empty-package.check index ecf79c2c6d..d3b75f685e 100644 --- a/test/files/run/repl-empty-package.check +++ b/test/files/run/repl-empty-package.check @@ -4,4 +4,4 @@ Type :help for more information. scala> println(Bippy.bippy) bippy! -scala> +scala> :quit diff --git a/test/files/run/repl-javap-app.check b/test/files/run/repl-javap-app.check index 1136b415d7..eb3718f44b 100644 --- a/test/files/run/repl-javap-app.check +++ b/test/files/run/repl-javap-app.check @@ -15,7 +15,7 @@ public final void delayedEndpoint$MyApp$1(); Start Length Slot Name Signature 0 9 0 this LMyApp$; -scala> +scala> :quit #partest java7 Welcome to Scala Type in expressions to have them evaluated. @@ -37,7 +37,7 @@ scala> :javap -app MyApp$ line 5: 0 } -scala> +scala> :quit #partest java8 Welcome to Scala Type in expressions to have them evaluated. @@ -60,4 +60,4 @@ scala> :javap -app MyApp$ line 5: 0 } -scala> +scala> :quit diff --git a/test/files/run/repl-out-dir.check b/test/files/run/repl-out-dir.check index 3e51c63155..c354492898 100644 --- a/test/files/run/repl-out-dir.check +++ b/test/files/run/repl-out-dir.check @@ -46,4 +46,4 @@ repl-out-dir-run.obj Test$.class Test.class -scala> +scala> :quit diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check index 15f4b4524a..74d15ff93c 100644 --- a/test/files/run/repl-parens.check +++ b/test/files/run/repl-parens.check @@ -81,4 +81,4 @@ scala> scala> List(1) ++ List('a') res16: List[AnyVal] = List(1, a) -scala> +scala> :quit diff --git a/test/files/run/repl-paste-2.check b/test/files/run/repl-paste-2.check index ab3809a2e0..6ea8e2f419 100644 --- a/test/files/run/repl-paste-2.check +++ b/test/files/run/repl-paste-2.check @@ -58,4 +58,4 @@ scala> x.length + res5 res3: Int = 129 -scala> +scala> :quit diff --git a/test/files/run/repl-paste-3.check b/test/files/run/repl-paste-3.check index 8fae61792e..23e402852f 100644 --- a/test/files/run/repl-paste-3.check +++ b/test/files/run/repl-paste-3.check @@ -7,4 +7,4 @@ scala> println(3) scala> List(1,2) res1: List[Int] = List(1, 2) -scala> +scala> :quit diff --git a/test/files/run/repl-paste-4.scala b/test/files/run/repl-paste-4.scala index 0060dc1ff6..cb0a6aa768 100644 --- a/test/files/run/repl-paste-4.scala +++ b/test/files/run/repl-paste-4.scala @@ -14,7 +14,7 @@ s"""|Type in expressions to have them evaluated. |scala> Foo(new Foo) |res0: Int = 7 | - |scala> """ + |scala> :quit""" def pastie = testPath changeExtension "pastie" } diff --git a/test/files/run/repl-paste-raw.scala b/test/files/run/repl-paste-raw.scala index 2953796f99..3b41254e96 100644 --- a/test/files/run/repl-paste-raw.scala +++ b/test/files/run/repl-paste-raw.scala @@ -15,6 +15,6 @@ s"""|Type in expressions to have them evaluated. |scala> favoriteThing.hasString |res0: Boolean = true | - |scala> """ + |scala> :quit""" def pastie = testPath changeExtension "pastie" } diff --git a/test/files/run/repl-paste.check b/test/files/run/repl-paste.check index 97f177ddc4..171447214f 100644 --- a/test/files/run/repl-paste.check +++ b/test/files/run/repl-paste.check @@ -23,4 +23,4 @@ defined class Dingus defined object Dingus x: Int = 110 -scala> +scala> :quit diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check index 8a8ca46012..e2318c93f2 100644 --- a/test/files/run/repl-power.check +++ b/test/files/run/repl-power.check @@ -27,4 +27,4 @@ m: $r.treedsl.global.Literal = 10 scala> typed(m).tpe // typed is in scope res2: $r.treedsl.global.Type = Int(10) -scala> +scala> :quit diff --git a/test/files/run/repl-reset.check b/test/files/run/repl-reset.check index ed95c7b8ff..cd7893bbc3 100644 --- a/test/files/run/repl-reset.check +++ b/test/files/run/repl-reset.check @@ -54,4 +54,4 @@ defined class BippyBungus scala> { new BippyBungus ; x1 } res2: Int = 4 -scala> +scala> :quit diff --git a/test/files/run/repl-save.scala b/test/files/run/repl-save.scala index 4539790b1a..c98e6aebc3 100644 --- a/test/files/run/repl-save.scala +++ b/test/files/run/repl-save.scala @@ -16,7 +16,7 @@ s"""|Type in expressions to have them evaluated. | |scala> :save $saveto | - |scala> """ + |scala> :quit""" def saveto = testOutput / "session.repl" override def show() = { super.show() diff --git a/test/files/run/repl-term-macros.check b/test/files/run/repl-term-macros.check index 3580bfe1f1..2cd0b93cd0 100644 --- a/test/files/run/repl-term-macros.check +++ b/test/files/run/repl-term-macros.check @@ -37,4 +37,4 @@ defined term macro foo3: (x: Int)(y: Int)Unit scala> foo3(2)(3) -scala> +scala> :quit diff --git a/test/files/run/repl-transcript.check b/test/files/run/repl-transcript.check index 49891af900..b0f106387b 100644 --- a/test/files/run/repl-transcript.check +++ b/test/files/run/repl-transcript.check @@ -35,4 +35,4 @@ scala> res6.sum + res5 res0: Int = 5273 -scala> +scala> :quit diff --git a/test/files/run/repl-trim-stack-trace.scala b/test/files/run/repl-trim-stack-trace.scala index 483659146a..a53ce3b3e4 100644 --- a/test/files/run/repl-trim-stack-trace.scala +++ b/test/files/run/repl-trim-stack-trace.scala @@ -32,7 +32,7 @@ java.lang.Exception at .f(<console>:7) ... 69 elided -scala> """ +scala> :quit""" // normalize the "elided" lines because the frame count depends on test context lazy val elided = """(\s+\.{3} )\d+( elided)""".r diff --git a/test/files/run/repl-type-verbose.check b/test/files/run/repl-type-verbose.check index e37754a060..6f6b47b86d 100644 --- a/test/files/run/repl-type-verbose.check +++ b/test/files/run/repl-type-verbose.check @@ -187,4 +187,4 @@ PolyType( ) ) -scala> +scala> :quit diff --git a/test/files/run/t3376.check b/test/files/run/t3376.check index cc6949d326..b8fd2843f6 100644 --- a/test/files/run/t3376.check +++ b/test/files/run/t3376.check @@ -13,4 +13,4 @@ m2: M[Float] = mmm scala> val m3 = new M[String]() m3: M[String] = mmm -scala> +scala> :quit diff --git a/test/files/run/t4025.check b/test/files/run/t4025.check index 2d4f644c5a..e8c6851236 100644 --- a/test/files/run/t4025.check +++ b/test/files/run/t4025.check @@ -14,4 +14,4 @@ scala> scala> def f(c: Any) = c match { case Red(_) => () } f: (c: Any)Unit -scala> +scala> :quit diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check index a748430e2e..315c1c9dbd 100644 --- a/test/files/run/t4172.check +++ b/test/files/run/t4172.check @@ -5,4 +5,4 @@ scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f warning: there was one feature warning; re-run with -feature for details c: (C, C{def f: Int}) forSome { type C <: AnyRef } = (C,C) -scala> +scala> :quit diff --git a/test/files/run/t4216.check b/test/files/run/t4216.check index 091e55a0c7..e4610e87d3 100644 --- a/test/files/run/t4216.check +++ b/test/files/run/t4216.check @@ -34,4 +34,4 @@ res4: java.util.List[V] = [V@0] scala> o(new V(0)) res5: java.util.List[Any] = [V@0] -scala> +scala> :quit diff --git a/test/files/run/t4285.check b/test/files/run/t4285.check index 314c8e5a35..b952cb8e1b 100644 --- a/test/files/run/t4285.check +++ b/test/files/run/t4285.check @@ -10,4 +10,4 @@ y: scala.collection.mutable.WrappedArray[Int] = WrappedArray(2, 4, 6, 8, 10, 12, scala> println(y.sum) 56 -scala> +scala> :quit diff --git a/test/files/run/t4542.check b/test/files/run/t4542.check index a53f31a3c7..f7716dc2f0 100644 --- a/test/files/run/t4542.check +++ b/test/files/run/t4542.check @@ -12,4 +12,4 @@ scala> val f = new Foo ^ f: Foo = Bippy -scala> +scala> :quit diff --git a/test/files/run/t4594-repl-settings.scala b/test/files/run/t4594-repl-settings.scala index 8b8b2e3746..4202991607 100644 --- a/test/files/run/t4594-repl-settings.scala +++ b/test/files/run/t4594-repl-settings.scala @@ -22,5 +22,5 @@ object Test extends SessionTest { | ^ |b: String | - |scala> """ + |scala> :quit""" } diff --git a/test/files/run/t4671.check b/test/files/run/t4671.check index 0c36083759..1640dac8e4 100644 --- a/test/files/run/t4671.check +++ b/test/files/run/t4671.check @@ -43,4 +43,4 @@ println(s.mkString("")) } -scala> +scala> :quit diff --git a/test/files/run/t4710.check b/test/files/run/t4710.check index 6ee7198b4b..0dd49dfbd3 100644 --- a/test/files/run/t4710.check +++ b/test/files/run/t4710.check @@ -5,4 +5,4 @@ scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol } warning: there was one feature warning; re-run with -feature for details method: String -scala> +scala> :quit diff --git a/test/files/run/t5072.check b/test/files/run/t5072.check index ddd49c71cb..ab34e49869 100644 --- a/test/files/run/t5072.check +++ b/test/files/run/t5072.check @@ -7,4 +7,4 @@ defined class C scala> Thread.currentThread.getContextClassLoader.loadClass(classOf[C].getName) res0: Class[_] = class C -scala> +scala> :quit diff --git a/test/files/run/t5256d.check b/test/files/run/t5256d.check index d42d234386..c2b49989ab 100644 --- a/test/files/run/t5256d.check +++ b/test/files/run/t5256d.check @@ -25,4 +25,4 @@ scala.AnyRef { def foo: scala.Nothing } -scala> +scala> :quit diff --git a/test/files/run/t5535.check b/test/files/run/t5535.check index a0c87a47f4..84097ccea9 100644 --- a/test/files/run/t5535.check +++ b/test/files/run/t5535.check @@ -13,4 +13,4 @@ f: Int => Int = <function1> scala> println(f(10)) 11 -scala> +scala> :quit diff --git a/test/files/run/t5537.check b/test/files/run/t5537.check index b9d521f301..98265ccc92 100644 --- a/test/files/run/t5537.check +++ b/test/files/run/t5537.check @@ -13,4 +13,4 @@ res2: List[scala.collection.immutable.List.type] = List() scala> List[Set.type]() res3: List[Set.type] = List() -scala> +scala> :quit diff --git a/test/files/run/t5583.check b/test/files/run/t5583.check index af96405bdd..32d285cbb3 100644 --- a/test/files/run/t5583.check +++ b/test/files/run/t5583.check @@ -13,4 +13,4 @@ scala> for (i <- 1 to 10) {s += i} scala> println(s) 165 -scala> +scala> :quit diff --git a/test/files/run/t5655.check b/test/files/run/t5655.check index 06c6b32599..4bbc54b641 100644 --- a/test/files/run/t5655.check +++ b/test/files/run/t5655.check @@ -23,4 +23,4 @@ and import x x ^ -scala> +scala> :quit diff --git a/test/files/run/t5789.check b/test/files/run/t5789.check index bcb2382559..193abfaff0 100644 --- a/test/files/run/t5789.check +++ b/test/files/run/t5789.check @@ -7,4 +7,4 @@ n: Int = 2 scala> () => n res0: () => Int = <function0> -scala> +scala> :quit diff --git a/test/files/run/t6086-repl.check b/test/files/run/t6086-repl.check index 115eff5f85..b904f118e8 100644 --- a/test/files/run/t6086-repl.check +++ b/test/files/run/t6086-repl.check @@ -7,4 +7,4 @@ defined class X scala> scala.reflect.runtime.universe.typeOf[X] res0: reflect.runtime.universe.Type = X -scala> +scala> :quit diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check index a3b09efcd9..6998873fb7 100644 --- a/test/files/run/t6146b.check +++ b/test/files/run/t6146b.check @@ -60,4 +60,4 @@ res2: u.Type = O.S3 scala> memType(S4, fTpe) res3: u.Type = S4 -scala> +scala> :quit diff --git a/test/files/run/t6187.check b/test/files/run/t6187.check index 0180125809..9a9e266ec6 100644 --- a/test/files/run/t6187.check +++ b/test/files/run/t6187.check @@ -29,4 +29,4 @@ res1: List[Int] = List(1) scala> List("") collect { case x => x } res2: List[String] = List("") -scala> +scala> :quit diff --git a/test/files/run/t6273.check b/test/files/run/t6273.check index bef0b227d2..3b682800df 100644 --- a/test/files/run/t6273.check +++ b/test/files/run/t6273.check @@ -12,4 +12,4 @@ x: String = y = 55 " -scala> +scala> :quit diff --git a/test/files/run/t6320.check b/test/files/run/t6320.check index 013acc1c54..af7c865690 100644 --- a/test/files/run/t6320.check +++ b/test/files/run/t6320.check @@ -10,4 +10,4 @@ defined class Dyn scala> new Dyn(Map("foo" -> 10)).foo[Int] res0: Int = 10 -scala> +scala> :quit diff --git a/test/files/run/t6329_repl.check b/test/files/run/t6329_repl.check index ad0bb46e5b..ebb1aace7c 100644 --- a/test/files/run/t6329_repl.check +++ b/test/files/run/t6329_repl.check @@ -32,4 +32,4 @@ res6: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collecti scala> classTag[scala.collection.immutable.Set[_]] res7: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set -scala> +scala> :quit diff --git a/test/files/run/t6329_repl_bug.check b/test/files/run/t6329_repl_bug.check index 38a8de5606..84297a629f 100644 --- a/test/files/run/t6329_repl_bug.check +++ b/test/files/run/t6329_repl_bug.check @@ -14,4 +14,4 @@ res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>] scala> scala.reflect.classTag[List[_]] res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List -scala> +scala> :quit diff --git a/test/files/run/t6381.check b/test/files/run/t6381.check index 4ed11d59ff..49c6a784ad 100644 --- a/test/files/run/t6381.check +++ b/test/files/run/t6381.check @@ -16,4 +16,4 @@ defined term macro pos: String scala> pos res0: String = class scala.reflect.internal.util.RangePosition -scala> +scala> :quit diff --git a/test/files/run/t6434.check b/test/files/run/t6434.check index f898b6b781..0a75ae2bd5 100644 --- a/test/files/run/t6434.check +++ b/test/files/run/t6434.check @@ -7,4 +7,4 @@ f: (x: => Int)Int scala> f _ res0: (=> Int) => Int = <function1> -scala> +scala> :quit diff --git a/test/files/run/t6439.check b/test/files/run/t6439.check index f8d5b3a8cd..c4b7591069 100644 --- a/test/files/run/t6439.check +++ b/test/files/run/t6439.check @@ -70,4 +70,4 @@ defined object lookup scala> lookup("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols res0: $r.intp.global.Symbol = type F -scala> +scala> :quit diff --git a/test/files/run/t6507.check b/test/files/run/t6507.check index 3536c42381..5da4aa3a24 100644 --- a/test/files/run/t6507.check +++ b/test/files/run/t6507.check @@ -21,4 +21,4 @@ scala> res0 ! res1: A = A -scala> +scala> :quit diff --git a/test/files/run/t6549.check b/test/files/run/t6549.check index d5dfc5ebe8..be3445927e 100644 --- a/test/files/run/t6549.check +++ b/test/files/run/t6549.check @@ -25,4 +25,4 @@ m(scala.Symbol("s")).xxx: Any = 's scala> val `"` = 0 ": Int = 0 -scala> +scala> :quit diff --git a/test/files/run/t6631.scala b/test/files/run/t6631.scala deleted file mode 100644 index e472b83d50..0000000000 --- a/test/files/run/t6631.scala +++ /dev/null @@ -1,18 +0,0 @@ -import reflect.ClassTag - -object Test extends App { - def intercept[T <: Throwable : ClassTag](act: => Any) = try { - act - } catch { - case x: Throwable => - val cls = implicitly[ClassTag[T]].runtimeClass - assert(cls.isInstance(x), (x.getClass, x, cls).toString) - } - assert(s"""\f\r\n\t""" == "\f\r\n\t") - - import StringContext.InvalidEscapeException - intercept[InvalidEscapeException](s"""\""") - intercept[InvalidEscapeException](s"""\x""") - intercept[InvalidEscapeException](s"\") - -} diff --git a/test/files/run/t6937.check b/test/files/run/t6937.check index 4729dc7006..5c5d4485b6 100644 --- a/test/files/run/t6937.check +++ b/test/files/run/t6937.check @@ -19,4 +19,4 @@ apiru: scala.reflect.api.Universe = <lazy> scala> apiru.typeTag[A].in(cm) res0: reflect.runtime.universe.TypeTag[A] = TypeTag[A] -scala> +scala> :quit diff --git a/test/files/run/t7185.check b/test/files/run/t7185.check index ebf85b731f..e4f80a8ff9 100644 --- a/test/files/run/t7185.check +++ b/test/files/run/t7185.check @@ -29,4 +29,4 @@ res0: Any = } } -scala> +scala> :quit diff --git a/test/files/run/t7319.check b/test/files/run/t7319.check index 2ac4142098..e35cfc90c0 100644 --- a/test/files/run/t7319.check +++ b/test/files/run/t7319.check @@ -40,4 +40,4 @@ scala> Range(1,2).toArray: Seq[_] scala> 0 res2: Int = 0 -scala> +scala> :quit diff --git a/test/files/run/t7482a.check b/test/files/run/t7482a.check index 943538f352..a21ef7b68f 100644 --- a/test/files/run/t7482a.check +++ b/test/files/run/t7482a.check @@ -7,4 +7,4 @@ v: java.util.ArrayList[String] = [] scala> val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5) v: java.util.ArrayList[String] = [] -scala> +scala> :quit diff --git a/test/files/run/t7634.check b/test/files/run/t7634.check index aea3b94da5..9c6b8b47dd 100644 --- a/test/files/run/t7634.check +++ b/test/files/run/t7634.check @@ -5,4 +5,4 @@ Type :help for more information. scala> .lines res1: List[String] = List(shello, world.) -scala> +scala> :quit diff --git a/test/files/run/t7747-repl.check b/test/files/run/t7747-repl.check index ad924f482c..105b238d01 100644 --- a/test/files/run/t7747-repl.check +++ b/test/files/run/t7747-repl.check @@ -283,4 +283,4 @@ object $read extends $read { } res3: List[Product with Serializable] = List(BippyBups(), PuppyPups(), Bingo()) -scala> +scala> :quit diff --git a/test/files/run/t7801.check b/test/files/run/t7801.check index d72060c684..e0b656b784 100644 --- a/test/files/run/t7801.check +++ b/test/files/run/t7801.check @@ -8,4 +8,4 @@ import g.abort scala> class C(val a: Any) extends AnyVal defined class C -scala> +scala> :quit diff --git a/test/files/run/t7805-repl-i.check b/test/files/run/t7805-repl-i.check index eecfff079a..7f66c06a11 100644 --- a/test/files/run/t7805-repl-i.check +++ b/test/files/run/t7805-repl-i.check @@ -8,4 +8,4 @@ Type :help for more information. scala> Console println Try(8) Success(8) -scala> +scala> :quit diff --git a/test/files/run/tpeCache-tyconCache.check b/test/files/run/tpeCache-tyconCache.check index a892f5477a..ff604819e0 100644 --- a/test/files/run/tpeCache-tyconCache.check +++ b/test/files/run/tpeCache-tyconCache.check @@ -16,4 +16,4 @@ res0: Boolean = true scala> AnyRefClass.tpe eq AnyRefClass.typeConstructor res1: Boolean = true -scala> +scala> :quit diff --git a/test/junit/scala/StringContextTest.scala b/test/junit/scala/StringContextTest.scala index 5abfe90cd1..608b82bd96 100644 --- a/test/junit/scala/StringContextTest.scala +++ b/test/junit/scala/StringContextTest.scala @@ -48,4 +48,31 @@ class StringContextTest { val res = processEscapes(s) assertEquals("Scala", res) } + + @Test def t6631_baseline() = assertEquals("\f\r\n\t", s"""\f\r\n\t""") + + @Test def t6631_badEscape() = assertThrows[InvalidEscapeException] { + s"""\x""" + } + + // verifying that the standard interpolators can be supplanted + @Test def antiHijack_?() = { + object AllYourStringsAreBelongToMe { case class StringContext(args: Any*) { def s(args: Any) = "!!!!" } } + import AllYourStringsAreBelongToMe._ + //assertEquals("????", s"????") + assertEquals("!!!!", s"????") // OK to hijack core interpolator ids + } + + @Test def fIf() = { + val res = f"${if (true) 2.5 else 2.5}%.2f" + assertEquals("2.50", res) + } + @Test def fIfNot() = { + val res = f"${if (false) 2.5 else 3.5}%.2f" + assertEquals("3.50", res) + } + @Test def fHeteroArgs() = { + val res = f"${3.14}%.2f rounds to ${3}%d" + assertEquals("3.14 rounds to 3", res) + } } diff --git a/test/junit/scala/reflect/QTest.scala b/test/junit/scala/reflect/QTest.scala new file mode 100644 index 0000000000..24c35dc401 --- /dev/null +++ b/test/junit/scala/reflect/QTest.scala @@ -0,0 +1,23 @@ + +package scala.reflect + +import org.junit.Test +import org.junit.Assert._ +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +import scala.tools.testing.AssertUtil._ + +@RunWith(classOf[JUnit4]) +class QTest { + + import reflect.runtime._ + import universe._ + @Test def qConstantsNotHomogenized() = { + //Apply(Select(Literal(Constant(1.0)), TermName("$plus")), List(Literal(Constant(1.0)))) + val t = q"${1} + ${1.0}" + val Apply(Select(Literal(Constant(i)), TermName("$plus")), List(Literal(Constant(j)))) = t + assertEquals(1, i) + assertEquals(1.0, j) + } +} diff --git a/test/junit/scala/util/matching/RegexTest.scala b/test/junit/scala/util/matching/RegexTest.scala index d25842cc57..5b13397d6a 100644 --- a/test/junit/scala/util/matching/RegexTest.scala +++ b/test/junit/scala/util/matching/RegexTest.scala @@ -27,4 +27,21 @@ class RegexTest { assertEquals("1", x) assertEquals("1", y) } + + @Test def t8787nullMatch() = { + val r = """\d+""".r + val s: String = null + val x = s match { case r() => 1 ; case _ => 2 } + assertEquals(2, x) + } + + @Test def t8787nullMatcher() = { + val r = """(\d+):(\d+)""".r + val s = "1:2 3:4 5:6" + val z = ((r findAllMatchIn s).toList :+ null) flatMap { + case r(x, y) => Some((x.toInt, y.toInt)) + case _ => None + } + assertEquals(List((1,2),(3,4),(5,6)), z) + } } |