From cd345b43378a24a75a78d699546a1f8964efc88f Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Tue, 14 Mar 2017 16:38:33 +0100 Subject: Add run testing capabilities --- tests/run/getclass.check | 4 ++-- tests/run/getclass.scala | 6 +++--- tests/run/origins.check | 6 ------ tests/run/origins.flags | 1 - tests/run/origins.scala | 21 --------------------- tests/run/shutdownhooks.check | 3 --- tests/run/shutdownhooks.scala | 37 ------------------------------------- 7 files changed, 5 insertions(+), 73 deletions(-) delete mode 100644 tests/run/origins.check delete mode 100644 tests/run/origins.flags delete mode 100644 tests/run/origins.scala delete mode 100644 tests/run/shutdownhooks.check delete mode 100644 tests/run/shutdownhooks.scala (limited to 'tests') diff --git a/tests/run/getclass.check b/tests/run/getclass.check index 9d88762f4..ea73f6127 100644 --- a/tests/run/getclass.check +++ b/tests/run/getclass.check @@ -22,5 +22,5 @@ class [D class [Lscala.collection.immutable.List; Functions: -class Test$$$Lambda$1 -class Test$$$Lambda$2 +class Test$$$Lambda$ +class Test$$$Lambda$ diff --git a/tests/run/getclass.scala b/tests/run/getclass.scala index 7a13a61a2..b74e1b202 100644 --- a/tests/run/getclass.scala +++ b/tests/run/getclass.scala @@ -35,8 +35,8 @@ object Test { println("\nFunctions:") // FunctionN.getClass.toString has form of "class Test$$$Lambda$N/1349414238", - // but number (1349414238) depends on environment - println(f1.getClass.toString.takeWhile(_ != '/')) - println(f2.getClass.toString.takeWhile(_ != '/')) + // but "N/1349414238" depends on environment + println(f1.getClass.toString.take("class Test$$$Lambda$".length)) + println(f2.getClass.toString.take("class Test$$$Lambda$".length)) } } diff --git a/tests/run/origins.check b/tests/run/origins.check deleted file mode 100644 index 54d58296b..000000000 --- a/tests/run/origins.check +++ /dev/null @@ -1,6 +0,0 @@ - ->> Origins tag 'boop' logged 65 calls from 3 distinguished sources. - - 50 Test$.$anonfun$f3$1(origins.scala:16) - 10 Test$.$anonfun$f2$1(origins.scala:15) - 5 Test$.$anonfun$f1$1(origins.scala:14) diff --git a/tests/run/origins.flags b/tests/run/origins.flags deleted file mode 100644 index 690753d80..000000000 --- a/tests/run/origins.flags +++ /dev/null @@ -1 +0,0 @@ --no-specialization -Ydelambdafy:inline \ No newline at end of file diff --git a/tests/run/origins.scala b/tests/run/origins.scala deleted file mode 100644 index 6529351d3..000000000 --- a/tests/run/origins.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.internal.util.Origins - -package goxbox { - object Socks { - val origins = Origins("boop") - - def boop(x: Int): Int = origins { 5 } - } -} - -object Test { - import goxbox.Socks.boop - - def f1() = 1 to 5 map boop - def f2() = 1 to 10 map boop - def f3() = 1 to 50 map boop - - def main(args: Array[String]): Unit = { - f1() ; f2() ; f3() - } -} diff --git a/tests/run/shutdownhooks.check b/tests/run/shutdownhooks.check deleted file mode 100644 index 29956956e..000000000 --- a/tests/run/shutdownhooks.check +++ /dev/null @@ -1,3 +0,0 @@ -Fooblitzky! -main#shutdown. -Test#shutdown. diff --git a/tests/run/shutdownhooks.scala b/tests/run/shutdownhooks.scala deleted file mode 100644 index 5f512a391..000000000 --- a/tests/run/shutdownhooks.scala +++ /dev/null @@ -1,37 +0,0 @@ -object Test { - scala.sys.addShutdownHook { - Thread.sleep(1000) - println("Test#shutdown.") - } - - def daemon() = { - val t = new Thread { - override def run(): Unit = { - Thread.sleep(10000) - println("Hallelujah!") // should not see this - } - } - t.setDaemon(true) - t.start() - t - } - - def nonDaemon() = { - val t = new Thread { - override def run(): Unit = { - Thread.sleep(100) - println("Fooblitzky!") - } - } - t.start() - t - } - - def main(args: Array[String]): Unit = { - daemon() - nonDaemon() - scala.sys.addShutdownHook { - println("main#shutdown.") - } - } -} -- cgit v1.2.3