aboutsummaryrefslogtreecommitdiff
path: root/tests/run
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-03-14 16:38:33 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-03-29 10:33:23 +0200
commitcd345b43378a24a75a78d699546a1f8964efc88f (patch)
treeec931f406ec844dae844e668c79583ec4cedfb52 /tests/run
parentc52457c7554f5a0648190562e6750067f811844c (diff)
downloaddotty-cd345b43378a24a75a78d699546a1f8964efc88f.tar.gz
dotty-cd345b43378a24a75a78d699546a1f8964efc88f.tar.bz2
dotty-cd345b43378a24a75a78d699546a1f8964efc88f.zip
Add run testing capabilities
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/getclass.check4
-rw-r--r--tests/run/getclass.scala6
-rw-r--r--tests/run/origins.check6
-rw-r--r--tests/run/origins.flags1
-rw-r--r--tests/run/origins.scala21
-rw-r--r--tests/run/shutdownhooks.check3
-rw-r--r--tests/run/shutdownhooks.scala37
7 files changed, 5 insertions, 73 deletions
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.")
- }
- }
-}