diff --git a/language-testutils/src/test/java/de/jplag/testutils/datacollector/TokenPositionTestData.java b/language-testutils/src/test/java/de/jplag/testutils/datacollector/TokenPositionTestData.java index d46288041..fb18c5deb 100644 --- a/language-testutils/src/test/java/de/jplag/testutils/datacollector/TokenPositionTestData.java +++ b/language-testutils/src/test/java/de/jplag/testutils/datacollector/TokenPositionTestData.java @@ -21,6 +21,7 @@ public class TokenPositionTestData implements TestData { private final List expectedTokens; private final String descriptor; + private final String fileName; /** * @param testFile The file containing the test specifications @@ -30,6 +31,7 @@ public TokenPositionTestData(File testFile) throws IOException { this.sourceLines = new ArrayList<>(); this.expectedTokens = new ArrayList<>(); this.descriptor = "(Token position file: " + testFile.getName() + ")"; + this.fileName = testFile.getName(); this.readFile(testFile); } @@ -89,4 +91,9 @@ public List getExpectedTokens() { */ public record TokenData(String typeName, int lineNumber, int columnNumber, int length) { } + + @Override + public String toString() { + return this.fileName; + } }