Add tests for validation and extract command from Main

This commit is contained in:
RatzzFatzz
2025-12-14 22:47:41 +01:00
parent a5b24e907d
commit 80c46508b8
16 changed files with 125 additions and 527 deletions

View File

@@ -7,7 +7,6 @@ import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.*;
@@ -35,9 +34,7 @@ class SubtitleTrackComparatorTest {
@ParameterizedTest
@MethodSource("compareArguments")
void compare(List<TrackAttributes> input, List<TrackAttributes> expected) {
List<TrackAttributes> result = input.stream().sorted(comparator.reversed()).collect(Collectors.toList());
assertArrayEquals(expected.toArray(new TrackAttributes[0]), result.toArray(new TrackAttributes[0]));
assertIterableEquals(expected, input.stream().sorted(comparator.reversed()).toList());
}
private static TrackAttributes attr(String trackName, boolean defaultTrack) {