From 7b0f0a142bb526f4bd108a8c208ec9a8952398c9 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 4 Jun 2012 13:53:13 +0200 Subject: repairs the tests after the refactoring spree --- test/files/run/reify_copypaste1.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/files/run/reify_copypaste1.scala (limited to 'test/files/run/reify_copypaste1.scala') diff --git a/test/files/run/reify_copypaste1.scala b/test/files/run/reify_copypaste1.scala new file mode 100644 index 0000000000..7eaa4fa7b5 --- /dev/null +++ b/test/files/run/reify_copypaste1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.universe.Flag._ +import scala.tools.reflect.ToolBox + +object Test extends App { + val stdout = System.out + val output = new java.io.ByteArrayOutputStream() + System.setOut(new java.io.PrintStream(output)) + val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste") + val reify = Select(Select(Select(Select(Ident(ScalaPackage), newTermName("reflect")), newTermName("runtime")), newTermName("universe")), newTermName("reify")) + val reifee = Block(List(ValDef(Modifiers(LAZY), newTermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(newTermName("x"))) + toolBox.runExpr(Apply(reify, List(reifee))) + val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parseExpr(output.toString()) + output.reset() + toolBox.runExpr(Block(stats, expr)) + stdout.println(output.toString) +} \ No newline at end of file -- cgit v1.2.3