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

@@ -16,7 +16,7 @@ public interface ParametersModel {
List<ExtractionModel> availableExtractionModels();
/**
* @return The current extraction model
* @return The current extraction model setting
*/
ExtractionModel extractionModel();
@@ -31,7 +31,7 @@ public interface ParametersModel {
List<OutputFormat> availableOutputFormats();
/**
* @return The current output format
* @return The current output format setting
*/
OutputFormat outputFormat();
@@ -46,7 +46,7 @@ public interface ParametersModel {
List<String> availableFontFamilies();
/**
* @return The current font family
* @return The current font family setting
*/
String fontName();
@@ -56,7 +56,7 @@ public interface ParametersModel {
void setFontName(String fontFamily);
/**
* @return The current font size
* @return The current font size setting
*/
int fontSize();
@@ -65,11 +65,27 @@ public interface ParametersModel {
*/
void setFontSize(int fontSize);
/**
* @return The current max line length setting
*/
int maxLineLength();
/**
* Sets the max line length
*
* @param maxLineLength The new max line length
*/
void setMaxLineLength(int maxLineLength);
/**
* @return The current max lines setting
*/
int maxLines();
/**
* Sets the max lines
*
* @param maxLines The new max lines
*/
void setMaxLines(int maxLines);
}

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));

View File

@@ -8,6 +8,7 @@ module com.github.gtache.autosubtitle.gui.run {
requires com.github.gtache.autosubtitle.whisperx;
requires javafx.fxml;
requires javafx.graphics;
requires guava;
opens com.github.gtache.autosubtitle.gui.run to javafx.graphics;
}