aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-09-28 12:05:32 +0100
committerMichael Williamson <mike@zwobble.org>2023-09-28 12:05:32 +0100
commit2f8e32636912e23552f5b43a2c84109b77fe7a92 (patch)
tree3fd8b56052a8dba9ab501f164fd83b2da545c7ab /src/test/java/org
parentb1ca0653b7bd80302a287faef3a7c7647f92d23a (diff)
Attach source to all compiler errors
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/shedlang/compiler/backends/ExampleTests.java8
-rw-r--r--src/test/java/org/shedlang/compiler/parser/ParserStringLiteralTests.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/ExampleTests.java b/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
index 5a6a7cbc..037041f3 100644
--- a/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
+++ b/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
@@ -3,10 +3,10 @@ package org.shedlang.compiler.backends;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
import org.shedlang.compiler.ShedCompiler;
-import org.shedlang.compiler.testing.ExecutionResult;
import org.shedlang.compiler.config.ProjectConfig;
-import org.shedlang.compiler.errors.SourceError;
+import org.shedlang.compiler.errors.CompilerError;
import org.shedlang.compiler.filesystem.ShedCompilerFiles;
+import org.shedlang.compiler.testing.ExecutionResult;
import org.shedlang.compiler.testing.TestProcessRunner;
import org.shedlang.compiler.util.P;
@@ -33,8 +33,8 @@ public abstract class ExampleTests {
try {
compiler.compile(exampleDirectory.toPath(), backend);
- } catch (SourceError error) {
- System.err.println(error.getSource().describe());
+ } catch (CompilerError error) {
+ System.err.println(error.source().describe());
throw error;
}
diff --git a/src/test/java/org/shedlang/compiler/parser/ParserStringLiteralTests.java b/src/test/java/org/shedlang/compiler/parser/ParserStringLiteralTests.java
index 6f4dbfc3..a9401cf9 100644
--- a/src/test/java/org/shedlang/compiler/parser/ParserStringLiteralTests.java
+++ b/src/test/java/org/shedlang/compiler/parser/ParserStringLiteralTests.java
@@ -47,7 +47,7 @@ public class ParserStringLiteralTests {
);
assertThat(error.getMessage(), equalTo("Unrecognised escape sequence: \\a"));
- assertThat(error.getSource(), instanceOf(FileFragmentSource.class, allOf(
+ assertThat(error.source(), instanceOf(FileFragmentSource.class, allOf(
has("characterIndexStart", x -> x.characterIndexStart(), equalTo(1)),
has("characterIndexEnd", x -> x.characterIndexEnd(), equalTo(3))
)));