From 6c505eab4ac4fd805ae4738a294c87bcd463b381 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 3 Sep 2024 15:40:23 +0200 Subject: [PATCH] Added names to token position tests --- .../testutils/datacollector/TokenPositionTestData.java | 7 +++++++ 1 file changed, 7 insertions(+) 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; + } }