Files
Java/src/test/java/com/thealgorithms/conversions/TurkishToLatinConversionTest.java

32 lines
1.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.thealgorithms.conversions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
public class TurkishToLatinConversionTest {
@ParameterizedTest
@CsvSource({
"'çalışma', 'calisma'", // Turkish to Latin conversion for lowercase
"'ÇALIŞMA', 'CALISMA'", // Turkish to Latin conversion for uppercase
"'İSTANBUL', 'ISTANBUL'", // Special case of 'İ' to 'I'
"'istanbul', 'istanbul'", // Special case of 'ı' to 'i'
"'GÜL', 'GUL'", // Special case of 'Ü' to 'U'
"'gül', 'gul'", // Special case of 'ü' to 'u'
"'ÖĞRENME', 'OGRENME'", // Special case of 'Ö' to 'O' and 'Ğ' to 'G'
"'öğrenme', 'ogrenme'", // Special case of 'ö' to 'o' and 'ğ' to 'g'
"'ŞEHIR', 'SEHIR'", // Special case of 'Ş' to 'S'
"'şehir', 'sehir'", // Special case of 'ş' to 's'
"'HELLO', 'HELLO'", // String with no Turkish characters, should remain unchanged
"'Merhaba Dünya!', 'Merhaba Dunya!'", // Mixed Turkish and Latin characters with punctuation
"'Çift kişilik yataklı odalar', 'Cift kisilik yatakli odalar'", // Full sentence conversion
"'', ''" // Empty string case
})
public void
testConvertTurkishToLatin(String input, String expectedOutput) {
assertEquals(expectedOutput, TurkishToLatinConversion.convertTurkishToLatin(input));
}
}