Fix tests for windows build

This commit is contained in:
RatzzFatzz
2025-12-16 16:35:02 +01:00
parent 69a70eb66f
commit f88fcd0bd5
4 changed files with 3 additions and 40 deletions

View File

@@ -85,10 +85,6 @@ public class InputConfig implements CommandLine.IVersionProvider {
System.setProperty("DEFAULT_MKV_TOOL_NIX", SystemUtils.IS_OS_WINDOWS ? "C:\\Program Files\\MKVToolNix" : "/usr/bin/");
}
public String getNormalizedLibraryPath() {
return this.getLibraryPath().getAbsolutePath().replace("\\", "/");
}
@Override
public String toString() {
return new StringJoiner(", ", InputConfig.class.getSimpleName() + "[", "]")

View File

@@ -1,13 +0,0 @@
package at.pcgamingfreaks.mkvaudiosubtitlechanger.util;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class SetUtils {
public static <T> Set<T> retainOf(List<T> list1, List<T> list2) {
Set<T> set = new HashSet<>(list1);
set.retainAll(list2);
return set;
}
}

View File

@@ -24,8 +24,8 @@ class ValidationExecutionStrategyTest {
.setExecutionStrategy(new ValidationExecutionStrategy())
.parseArgs("-a", "ger:ger", "-l", TEST_FILE, "-m", TEST_MKVTOOLNIX_DIR);
assertEquals(TEST_FILE, underTest.getConfig().getLibraryPath().getPath());
assertEquals(TEST_MKVTOOLNIX_DIR, underTest.getConfig().getMkvToolNix().getPath());
assertEquals(TEST_FILE, underTest.getConfig().getLibraryPath().getPath().replace("\\", "/"));
assertEquals(TEST_MKVTOOLNIX_DIR, underTest.getConfig().getMkvToolNix().getPath().replace("\\", "/"));
}
private static Stream<Arguments> validateFailure() {
@@ -56,6 +56,6 @@ class ValidationExecutionStrategyTest {
.execute(args);
printWriter.flush();
assertEquals(expectedMessage, writer.toString().split("\n")[0]);
assertEquals(expectedMessage, writer.toString().split("[\r\n]")[0]);
}
}

View File

@@ -1,20 +0,0 @@
package at.pcgamingfreaks.mkvaudiosubtitlechanger.util;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.*;
class SetUtilsTest {
@Test
void retainOf() {
List<Integer> list1 = List.of(1, 2, 3, 4, 5);
List<Integer> list2 = List.of(2, 4, 6, 8, 10);
Set<Integer> expected = Set.of(2, 4);
assertEquals(expected, SetUtils.retainOf(list1, list2));
}
}