diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-06 04:16:36 +0900 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-03-08 13:30:48 +0100 |
commit | 739a730954e399e7a431b852410f684d0c92fb2f (patch) | |
tree | 9a26aae6f6fb759b397be75933c01db9b66b6dc5 /tests/disabled/scalac-dependent/run | |
parent | 904d3bc1907e825f9cd9e17d1e8c538dc2a45357 (diff) | |
download | dotty-739a730954e399e7a431b852410f684d0c92fb2f.tar.gz dotty-739a730954e399e7a431b852410f684d0c92fb2f.tar.bz2 dotty-739a730954e399e7a431b852410f684d0c92fb2f.zip |
Disable most tests that depend on scala-reflect
Diffstat (limited to 'tests/disabled/scalac-dependent/run')
-rw-r--r-- | tests/disabled/scalac-dependent/run/bytecodecs.scala | 39 | ||||
-rw-r--r-- | tests/disabled/scalac-dependent/run/var-arity-class-symbol.scala | 19 |
2 files changed, 58 insertions, 0 deletions
diff --git a/tests/disabled/scalac-dependent/run/bytecodecs.scala b/tests/disabled/scalac-dependent/run/bytecodecs.scala new file mode 100644 index 000000000..454958dfa --- /dev/null +++ b/tests/disabled/scalac-dependent/run/bytecodecs.scala @@ -0,0 +1,39 @@ +import scala.reflect.internal.pickling.ByteCodecs._ + +object Test { + + def test8to7(xs: Array[Byte]): Unit = { + val ys = encode8to7(xs) + decode7to8(ys, ys.length) + assert(ys.take(xs.length).deep == xs.deep, + "test8to7("+xs.deep+") failed, result = "+ys.take(xs.length).deep) + } + + def testAll(xs: Array[Byte]): Unit = { + val ys = encode(xs) + decode(ys) + assert(ys.take(xs.length).deep == xs.deep, + "testAll("+xs.deep+") failed, result = "+ys.take(xs.length).deep) + } + + def test(inputs: Array[Byte]*): Unit = { + for (input <- inputs) { + test8to7(input) + testAll(input) + } + } + + def main(args: Array[String]): Unit = { + test( + Array(1, 2, 3), + Array(1, 2, 3, 4, 5, 6, 7), + Array(1, -2, 0, -3, -5, -6, -7), + Array(1, 3, -1, -128, 0, 0, -128, 1, 2, 3)) + val rand = new scala.util.Random() + for (i <- 1 until 5000) { + var xs = new Array[Byte](i) + rand.nextBytes(xs) + test(xs) + } + } +} diff --git a/tests/disabled/scalac-dependent/run/var-arity-class-symbol.scala b/tests/disabled/scalac-dependent/run/var-arity-class-symbol.scala new file mode 100644 index 000000000..2a7d32987 --- /dev/null +++ b/tests/disabled/scalac-dependent/run/var-arity-class-symbol.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._, definitions._ +object Test extends dotty.runtime.LegacyApp { + // Tuples + assert(TupleClass.seq.size == 22) + assert(TupleClass(0) == NoSymbol) + assert(TupleClass(23) == NoSymbol) + assert((1 to 22).forall { i => TupleClass(i).name.toString == s"Tuple$i" }) + // Functions + assert(FunctionClass.seq.size == 23) + assert(FunctionClass(-1) == NoSymbol) + assert(FunctionClass(23) == NoSymbol) + assert((0 to 22).forall { i => FunctionClass(i).name.toString == s"Function$i" }) + // Products + assert(ProductClass.seq.size == 23) + assert(ProductClass(-1) == NoSymbol) + assert(ProductClass(0) == UnitClass) + assert(ProductClass(23) == NoSymbol) + assert((1 to 22).forall { i => ProductClass(i).name.toString == s"Product$i" }) +} |