diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6488.check | 1 | ||||
-rw-r--r-- | test/files/run/t6488.scala | 11 | ||||
-rw-r--r-- | test/files/run/t6500.scala | 13 | ||||
-rw-r--r-- | test/files/run/t6534.scala | 14 | ||||
-rw-r--r-- | test/files/run/t6559.scala | 17 |
5 files changed, 56 insertions, 0 deletions
diff --git a/test/files/run/t6488.check b/test/files/run/t6488.check new file mode 100644 index 0000000000..35821117c8 --- /dev/null +++ b/test/files/run/t6488.check @@ -0,0 +1 @@ +Success diff --git a/test/files/run/t6488.scala b/test/files/run/t6488.scala new file mode 100644 index 0000000000..487614ecfd --- /dev/null +++ b/test/files/run/t6488.scala @@ -0,0 +1,11 @@ +import sys.process._ +object Test { + // Program that prints "Success" if the command was successfully run then destroyed + // It will silently pass if the command "/bin/ls" does not exist + // It will fail due to the uncatchable exception in t6488 race condition + def main(args: Array[String]) { + try Process("/bin/ls").run(ProcessLogger { _ => () }).destroy + catch { case _ => () } + println("Success") + } +} diff --git a/test/files/run/t6500.scala b/test/files/run/t6500.scala new file mode 100644 index 0000000000..03a68a3a24 --- /dev/null +++ b/test/files/run/t6500.scala @@ -0,0 +1,13 @@ +object Test extends App { + class Box(val value: Int) extends AnyVal + + trait Foo { + def append(box: Box): Foo + } + + class Bar extends Foo { + override def append(box: Box): Bar = this // produces bad forwarder + } + + ((new Bar): Foo).append(new Box(0)) +} diff --git a/test/files/run/t6534.scala b/test/files/run/t6534.scala new file mode 100644 index 0000000000..33df97e41e --- /dev/null +++ b/test/files/run/t6534.scala @@ -0,0 +1,14 @@ +trait Foo extends Any { override def equals(x: Any) = false } +trait Ding extends Any { override def hashCode = -1 } + +class Bippy1(val x: Int) extends AnyVal with Foo { } // warn +class Bippy2(val x: Int) extends AnyVal with Ding { } // warn + +object Test { + def main(args: Array[String]): Unit = { + val b1 = new Bippy1(71) + val b2 = new Bippy2(71) + assert(b1 == b1 && b1.## == b1.x.##, ((b1, b1.##))) + assert(b2 == b2 && b2.## == b2.x.##, ((b2, b2.##))) + } +} diff --git a/test/files/run/t6559.scala b/test/files/run/t6559.scala new file mode 100644 index 0000000000..5c671f7275 --- /dev/null +++ b/test/files/run/t6559.scala @@ -0,0 +1,17 @@ + +object Test { + + def main(args: Array[String]) = { + val one = "1" + val two = "2" + + val raw = raw"\n$one\n$two\n" + val escaped = s"\n$one\n$two\n" + val buggy = "\\n1\n2\n" + val correct = "\\n1\\n2\\n" + + assert(raw != escaped, "Raw strings should not be escaped.") + assert(raw != buggy, "Raw strings after variables should not be escaped.") + assert(raw == correct, "Raw strings should stay raw.") + } +} |