diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/duration-coarsest.scala | 28 | ||||
-rw-r--r-- | test/files/run/t5313.scala | 2 | ||||
-rw-r--r-- | test/files/run/tailcalls.check | 56 | ||||
-rw-r--r-- | test/files/run/tailcalls.scala | 2 |
4 files changed, 86 insertions, 2 deletions
diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala new file mode 100644 index 0000000000..51cb79287a --- /dev/null +++ b/test/files/run/duration-coarsest.scala @@ -0,0 +1,28 @@ +import scala.concurrent.duration._ +import scala.language.postfixOps + +object Test extends App { + List( + (60 minutes, 1 hour), + (2000 millis, 2 seconds), + (2000 micros, 2 millis), + (2000 nanos, 2 micros), + (2000000 nanos, 2 millis), + (48 hours, 2 days), + (5 seconds, 5 seconds), + (1 second, 1 second) + ) foreach { + case (x, expected) => + val actual = x.toCoarsest + assert(actual.unit == expected.unit, s"$actual, $expected") + assert(actual.length == expected.length, s"$actual, $expected") + } + + List( + 45 minutes, + 500 millis, + 1500 millis, + 23 hours, + 40 days + ) foreach (x => assert(x == x.toCoarsest, x)) +}
\ No newline at end of file diff --git a/test/files/run/t5313.scala b/test/files/run/t5313.scala index 7da8726a1f..febfd9c3ed 100644 --- a/test/files/run/t5313.scala +++ b/test/files/run/t5313.scala @@ -7,7 +7,7 @@ object Test extends IcodeTest { override def code = """class Foo { - def randomBoolean = util.Random.nextInt % 2 == 0 + def randomBoolean = scala.util.Random.nextInt % 2 == 0 def bar = { var kept1 = new Object val result = new java.lang.ref.WeakReference(kept1) diff --git a/test/files/run/tailcalls.check b/test/files/run/tailcalls.check index f123bc8f25..10384ac46e 100644 --- a/test/files/run/tailcalls.check +++ b/test/files/run/tailcalls.check @@ -1,3 +1,4 @@ +#partest !avian test Object .f was successful test Final .f was successful test Class .f raised exception java.lang.StackOverflowError @@ -51,3 +52,58 @@ test TailCall.b2 was successful test FancyTailCalls.tcTryLocal was successful test FancyTailCalls.differentInstance was successful test PolyObject.tramp was successful + +#partest avian +test Object .f was successful +test Final .f was successful +test Class .f was successful +test SubClass .f was successful +test Sealed .f was successful +test SubSealed.f was successful + +test O .f was successful +test c .f was successful +test O.O .f was successful +test O.c .f was successful +test c.O .f was successful +test c.c .f was successful +test O.O.O .f was successful +test O.O.c .f was successful +test O.c.O .f was successful +test O.c.c .f was successful +test c.O.O .f was successful +test c.O.c .f was successful +test c.c.O .f was successful +test c.c.c .f was successful +test O.O.O.O.f was successful +test O.O.O.c.f was successful +test O.O.c.O.f was successful +test O.O.c.c.f was successful +test O.c.O.O.f was successful +test O.c.O.c.f was successful +test O.c.c.O.f was successful +test O.c.c.c.f was successful +test c.O.O.O.f was successful +test c.O.O.c.f was successful +test c.O.c.O.f was successful +test c.O.c.c.f was successful +test c.c.O.O.f was successful +test c.c.O.c.f was successful +test c.c.c.O.f was successful +test c.c.c.c.f was successful + +test TailCall.f1 was successful +test TailCall.f2 was successful +test TailCall.f3 was successful +test TailCall.g1 was successful +test TailCall.g2 was successful +test TailCall.g3 was successful +test TailCall.h1 was successful + +test NonTailCall.f1 0 1 2 was successful +test NonTailCall.f2 +test TailCall.b1 was successful +test TailCall.b2 was successful +test FancyTailCalls.tcTryLocal was successful +test FancyTailCalls.differentInstance was successful +test PolyObject.tramp was successful
\ No newline at end of file diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index 7d06a7e69d..1d4124e138 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -307,7 +307,7 @@ object Test { def main(args: Array[String]) { // compute min and max iteration number val min = 16; - val max = calibrate; + val max = if (scala.tools.partest.utils.Properties.isAvian) 10000 else calibrate // test tail calls in different contexts val Final = new Final() |