From 0781b31fa4e3d22cb6a51882b8d632ea9a16ed6f Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 29 Sep 2016 15:45:46 +0200 Subject: Handle multiline messages in ConsoleReporter --- tests/repl/errmsgs.check | 90 ++++++++++++++++++++++++------------------------ tests/repl/imports.check | 16 +++------ 2 files changed, 50 insertions(+), 56 deletions(-) (limited to 'tests/repl') diff --git a/tests/repl/errmsgs.check b/tests/repl/errmsgs.check index b8cff5ba2..2a65fd949 100644 --- a/tests/repl/errmsgs.check +++ b/tests/repl/errmsgs.check @@ -2,46 +2,46 @@ scala> class Inv[T](x: T) defined class Inv scala> val x: List[String] = List(1) -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -3:val x: List[String] = List(1) - ^ - found: Int(1) - required: String - +4 |val x: List[String] = List(1) + | ^ + | found: Int(1) + | required: String + | scala> val y: List[List[String]] = List(List(1)) -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -3:val y: List[List[String]] = List(List(1)) - ^ - found: Int(1) - required: String - +4 |val y: List[List[String]] = List(List(1)) + | ^ + | found: Int(1) + | required: String + | scala> val z: (List[String], List[Int]) = (List(1), List("a")) -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -3:val z: (List[String], List[Int]) = (List(1), List("a")) - ^ - found: Int(1) - required: String - +4 |val z: (List[String], List[Int]) = (List(1), List("a")) + | ^ + | found: Int(1) + | required: String + | -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -3:val z: (List[String], List[Int]) = (List(1), List("a")) - ^^^ - found: String("a") - required: Int - +4 |val z: (List[String], List[Int]) = (List(1), List("a")) + | ^^^ + | found: String("a") + | required: Int + | scala> val a: Inv[String] = new Inv(new Inv(1)) -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -4:val a: Inv[String] = new Inv(new Inv(1)) - ^^^^^ - found: Inv[T] - required: String - - where: T is a type variable with constraint >: Int(1) +5 |val a: Inv[String] = new Inv(new Inv(1)) + | ^^^^^ + | found: Inv[T] + | required: String + | + | where: T is a type variable with constraint >: Int(1) scala> val b: Inv[String] = new Inv(1) -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -4:val b: Inv[String] = new Inv(1) - ^ - found: Int(1) - required: String - +5 |val b: Inv[String] = new Inv(1) + | ^ + | found: Int(1) + | required: String + | scala> abstract class C { type T val x: T @@ -58,19 +58,19 @@ scala> abstract class C { } } -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -8: var y: T = x - ^ - found: C.this.T(C.this.x) - required: T' - - where: T is a type in class C - T' is a type in the initalizer of value s which is an alias of String +9 | var y: T = x + | ^ + | found: C.this.T(C.this.x) + | required: T' + | + | where: T is a type in class C + | T' is a type in the initalizer of value s which is an alias of String -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -12: val z: T = y - ^ - found: T(y) - required: T' - - where: T is a type in the initalizer of value s which is an alias of String - T' is a type in method f which is an alias of Int +13 | val z: T = y + | ^ + | found: T(y) + | required: T' + | + | where: T is a type in the initalizer of value s which is an alias of String + | T' is a type in method f which is an alias of Int scala> :quit diff --git a/tests/repl/imports.check b/tests/repl/imports.check index 2e8d5dcf9..9743d2b94 100644 --- a/tests/repl/imports.check +++ b/tests/repl/imports.check @@ -8,17 +8,11 @@ scala> import o._ import o._ scala> buf += xs -- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -10:buf += xs - ^^ - found: scala.collection.immutable.List[Int](o.xs) - required: String - --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- -10:buf += xs - ^^^^^^^^^ - found: String - required: scala.collection.mutable.ListBuffer[Int] - +11 |buf += xs + | ^^ + | found: scala.collection.immutable.List[Int](o.xs) + | required: String + | scala> buf ++= xs res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3) scala> :quit -- cgit v1.2.3