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

Commit d09cab8

Browse files
committed
Wrap refactoring logic in ask calls to prevent race conditions
1 parent 65f62db commit d09cab8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ReusingPrinterTest extends TestHelper with SilentTracing {
2626
def printsTo(expectedOutput: String): Unit = {
2727
val sourceFile = new BatchSourceFile("noname", expectedOutput)
2828
val expected = stripWhitespacePreservers(expectedOutput).trim()
29-
val actual = generate(original, sourceFile = Some(sourceFile)).asText.trim()
29+
val actual = ask { () => generate(original, sourceFile = Some(sourceFile)).asText.trim() }
3030
if (actual != expected)
3131
throw new ComparisonFailure("", expected, actual)
3232
}
@@ -36,7 +36,7 @@ class ReusingPrinterTest extends TestHelper with SilentTracing {
3636
}
3737
final implicit class OrToDieAfter(input: (String, String)) {
3838
def after(trans: Transformation[Tree, Tree]): Unit = {
39-
val t = trans(treeFrom(input._1))
39+
val t = ask { () => trans(treeFrom(input._1)) }
4040
require(t.isDefined, "transformation was not successful")
4141
t foreach (_.printsTo(input._2))
4242
}

0 commit comments

Comments
 (0)