From 62e741384b4b4cb8dad98a848e2f638aab343dab Mon Sep 17 00:00:00 2001 From: peng Date: Fri, 8 Sep 2023 14:58:37 -0400 Subject: [PATCH] simplify test resources of acceptance module --- core/src/testFixtures/scala/splain/TestHelpers.scala | 2 ++ .../splain/builtin/BasicSpec/__direct/check | 0 .../src/test/scala/splain/acceptance/Acceptance.scala | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) rename testing/acceptance/src/test/{resources-2.13.7+/latest => resources}/splain/builtin/BasicSpec/__direct/check (100%) diff --git a/core/src/testFixtures/scala/splain/TestHelpers.scala b/core/src/testFixtures/scala/splain/TestHelpers.scala index 940aaa6..1ede382 100644 --- a/core/src/testFixtures/scala/splain/TestHelpers.scala +++ b/core/src/testFixtures/scala/splain/TestHelpers.scala @@ -30,6 +30,8 @@ trait TestHelpers extends Suite { val path = resourcePath(name, fname) val resource = ClassLoader.getSystemClassLoader.getResource(path.toString) + require(resource != null, s"Cannot find resource: $path") + val actualPath = Paths.get(resource.toURI) new String(Files.readAllBytes(actualPath)) diff --git a/testing/acceptance/src/test/resources-2.13.7+/latest/splain/builtin/BasicSpec/__direct/check b/testing/acceptance/src/test/resources/splain/builtin/BasicSpec/__direct/check similarity index 100% rename from testing/acceptance/src/test/resources-2.13.7+/latest/splain/builtin/BasicSpec/__direct/check rename to testing/acceptance/src/test/resources/splain/builtin/BasicSpec/__direct/check diff --git a/testing/acceptance/src/test/scala/splain/acceptance/Acceptance.scala b/testing/acceptance/src/test/scala/splain/acceptance/Acceptance.scala index 3806474..f1e0acf 100644 --- a/testing/acceptance/src/test/scala/splain/acceptance/Acceptance.scala +++ b/testing/acceptance/src/test/scala/splain/acceptance/Acceptance.scala @@ -12,7 +12,7 @@ object Acceptance { trait SpecBase extends AnyFunSpec with TestHelpers with static.FromCodeMixin { - val buffer: ArrayBuffer[TryCompile] = ArrayBuffer.empty + lazy val buffer: ArrayBuffer[TryCompile] = ArrayBuffer.empty def check(v: TryCompile): Unit = { buffer += v