Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit 7d70394

Browse files
committed
Execute all tests in ReusingPrinterTest in one ask call
1 parent f392719 commit 7d70394

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

org.scala-refactoring.library/src/test/scala/scala/tools/refactoring/tests/sourcegen/ReusingPrinterTest.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class ReusingPrinterTest extends TestHelper with SilentTracing {
2424
}
2525

2626
final implicit class ImplicitTreeHelper(original: Tree) {
27+
/** Needs to be executed on the PC thread. */
2728
def printsTo(expectedOutput: String): Unit = {
2829
val sourceFile = new BatchSourceFile("noname", expectedOutput)
2930
val expected = stripWhitespacePreservers(expectedOutput).trim()
30-
val actual = ask { () => generate(original, sourceFile = Some(sourceFile)).asText.trim() }
31+
val actual = generate(original, sourceFile = Some(sourceFile)).asText.trim()
3132
if (actual != expected)
3233
throw new ComparisonFailure("", expected, actual)
3334
}
@@ -36,8 +37,8 @@ class ReusingPrinterTest extends TestHelper with SilentTracing {
3637
def becomes(expectedOutput: String) = input -> expectedOutput
3738
}
3839
final implicit class OrToDieAfter(input: (String, String)) {
39-
def after(trans: Transformation[Tree, Tree]): Unit = {
40-
val t = ask { () => trans(treeFrom(input._1)) }
40+
def after(trans: Transformation[Tree, Tree]): Unit = ask { () =>
41+
val t = trans(treeFrom(input._1))
4142
require(t.isDefined, "transformation was not successful")
4243
t foreach (_.printsTo(input._2))
4344
}

0 commit comments

Comments
 (0)