|
| 1 | +package com.thealgorithms.conversions; |
| 2 | + |
| 3 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 4 | + |
| 5 | +import org.junit.jupiter.params.ParameterizedTest; |
| 6 | +import org.junit.jupiter.params.provider.CsvSource; |
| 7 | + |
| 8 | +public class TurkishToLatinConversionTest { |
| 9 | + |
| 10 | + @ParameterizedTest |
| 11 | + @CsvSource({ |
| 12 | + "'çalışma', 'calisma'", // Turkish to Latin conversion for lowercase |
| 13 | + "'ÇALIŞMA', 'CALISMA'", // Turkish to Latin conversion for uppercase |
| 14 | + "'İSTANBUL', 'ISTANBUL'", // Special case of 'İ' to 'I' |
| 15 | + "'istanbul', 'istanbul'", // Special case of 'ı' to 'i' |
| 16 | + "'GÜL', 'GUL'", // Special case of 'Ü' to 'U' |
| 17 | + "'gül', 'gul'", // Special case of 'ü' to 'u' |
| 18 | + "'ÖĞRENME', 'OGRENME'", // Special case of 'Ö' to 'O' and 'Ğ' to 'G' |
| 19 | + "'öğrenme', 'ogrenme'", // Special case of 'ö' to 'o' and 'ğ' to 'g' |
| 20 | + "'ŞEHIR', 'SEHIR'", // Special case of 'Ş' to 'S' |
| 21 | + "'şehir', 'sehir'", // Special case of 'ş' to 's' |
| 22 | + "'HELLO', 'HELLO'", // String with no Turkish characters, should remain unchanged |
| 23 | + "'Merhaba Dünya!', 'Merhaba Dunya!'", // Mixed Turkish and Latin characters with punctuation |
| 24 | + "'Çift kişilik yataklı odalar', 'Cift kisilik yatakli odalar'", // Full sentence conversion |
| 25 | + "'', ''" // Empty string case |
| 26 | + }) |
| 27 | + public void |
| 28 | + testConvertTurkishToLatin(String input, String expectedOutput) { |
| 29 | + assertEquals(expectedOutput, TurkishToLatinConversion.convertTurkishToLatin(input)); |
| 30 | + } |
| 31 | +} |
0 commit comments