diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-06-04 13:53:13 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-06-08 15:32:17 +0200 |
commit | 7b0f0a142bb526f4bd108a8c208ec9a8952398c9 (patch) | |
tree | ee13d036756be41521a9eb3f1e05898410ab744e /test/files/run/reify_printf.scala | |
parent | d9103e01b467634d61baa3b131aeb93fca9e20a5 (diff) | |
download | scala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.tar.gz scala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.tar.bz2 scala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.zip |
repairs the tests after the refactoring spree
Diffstat (limited to 'test/files/run/reify_printf.scala')
-rw-r--r-- | test/files/run/reify_printf.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala index dc092c1a85..1b1c6fdbb8 100644 --- a/test/files/run/reify_printf.scala +++ b/test/files/run/reify_printf.scala @@ -1,20 +1,20 @@ import java.io.{ ByteArrayOutputStream, PrintStream } -import scala.reflect.mirror._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox import scala.reflect.api._ import scala.reflect.api.Trees import scala.reflect.internal.Types import scala.util.matching.Regex object Test extends App { - val tree = tree_printf(reify("hello %s").tree, reify("world").tree) - - import scala.reflect.mirror._ - val toolbox = mkToolBox() - val output = new ByteArrayOutputStream() Console.setOut(new PrintStream(output)) - val evaluated = toolbox.runExpr(tree) + val toolbox = cm.mkToolBox() + val tree = tree_printf(reify("hello %s").tree, reify("world").tree) + val evaluated = toolbox.runExpr(tree) assert(output.toString() == "hello world", output.toString() +" == hello world") /* @@ -30,9 +30,9 @@ object Test extends App { ( Some( ValDef( - Modifiers() + NoMods , local - , TypeTree().setType(tpe) + , TypeTree(tpe) , value ) ) @@ -44,8 +44,8 @@ object Test extends App { val Literal(Constant(s_format: String)) = format val paramsStack = scala.collection.mutable.Stack(params: _*) val parsed = s_format.split("(?<=%[\\w%])|(?=%[\\w%])") map { - case "%d" => createTempValDef( paramsStack.pop, classToType(classOf[Int]) ) - case "%s" => createTempValDef( paramsStack.pop, classToType(classOf[String]) ) + case "%d" => createTempValDef( paramsStack.pop, IntTpe ) + case "%s" => createTempValDef( paramsStack.pop, StringTpe ) case "%%" => { (None:Option[Tree], Literal(Constant("%"))) } @@ -68,4 +68,4 @@ object Test extends App { ): Tree Block((evals ++ prints).toList, Literal(Constant(()))) } -} +}
\ No newline at end of file |