Adds tests for common whisper

This commit is contained in:
Guillaume Tâche
2024-09-16 14:01:57 +02:00
parent dcadbcaf36
commit 3cc2f7a0c9
38 changed files with 796 additions and 130 deletions

View File

@@ -12,15 +12,15 @@ class TestColonTimeFormatter {
@ParameterizedTest
@CsvSource({
"12:34:56,45296000",
"12:34,754000",
"01:02,62000",
"1:2,62000",
"01:02:03,3723000",
"1:2:3,3723000",
"00:00:03,3000",
"00:03,3000",
"1234:00:01,4442401000"
"12:34:56.000,45296000",
"12:34.321,754321",
"01:02.000,62000",
"1:2.555,62555",
"01:02:03.000,3723000",
"1:2:3.000,3723000",
"00:00:03.000,3000",
"00:03.000,3000",
"1234:00:01.000,4442401000"
})
void testParse(final String time, final long millis) {
assertEquals(millis, timeFormatter.parse(time));
@@ -28,14 +28,14 @@ class TestColonTimeFormatter {
@ParameterizedTest
@CsvSource({
"45296000,12:34:56",
"45296521,12:34:56",
"754000,12:34",
"754620,12:34",
"62000,01:02",
"3723000,1:02:03",
"3000,00:03",
"4442401000,1234:00:01"
"45296000,12:34:56.000",
"45296521,12:34:56.521",
"754000,12:34.000",
"754620,12:34.620",
"62000,01:02.000",
"3723000,1:02:03.000",
"3000,00:03.000",
"4442401000,1234:00:01.000"
})
void testFormat(final long millis, final String time) {
assertEquals(time, timeFormatter.format(millis));