Skip to content

Commit

Permalink
Removed the @tempdir annotation, since it caused some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoOfTwelve committed Aug 5, 2023
1 parent 3ef79f0 commit a86bac4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions languages/text/src/test/java/jplag/text/NaturalLanguageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.slf4j.Logger;
Expand Down Expand Up @@ -54,19 +53,19 @@ void testParsingJavaDoc() throws ParsingException {

@ParameterizedTest
@ValueSource(strings = {"\n", "\r", "\r\n",})
void testLineBreakInputs(String input, @TempDir Path tempDir) throws IOException, ParsingException {
Path filePath = tempDir.resolve("input.txt");
Files.writeString(filePath, input);
List<Token> result = language.parse(Set.of(filePath.toFile()));
void testLineBreakInputs(String input) throws IOException, ParsingException {
File testFile = File.createTempFile("input", "txt");
Files.writeString(testFile.toPath(), input);
List<Token> result = language.parse(Set.of(testFile));
assertEquals(1, result.size());
}

@ParameterizedTest
@ValueSource(strings = {"\ntoken", "\rtoken", "\r\ntoken",})
void testTokenAfterLineBreak(String input, @TempDir Path tempDir) throws IOException, ParsingException {
Path filePath = tempDir.resolve("input.txt");
Files.writeString(filePath, input);
List<Token> result = language.parse(Set.of(filePath.toFile()));
void testTokenAfterLineBreak(String input) throws IOException, ParsingException {
File testFile = File.createTempFile("input", "txt");
Files.writeString(testFile.toPath(), input);
List<Token> result = language.parse(Set.of(testFile));
assertEquals(2, result.get(0).getLine());
}

Expand Down

0 comments on commit a86bac4

Please sign in to comment.