summaryrefslogtreecommitdiff
path: root/internal/comic/localization_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/comic/localization_test.go')
-rw-r--r--internal/comic/localization_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/comic/localization_test.go b/internal/comic/localization_test.go
index 8855732..9da0f11 100644
--- a/internal/comic/localization_test.go
+++ b/internal/comic/localization_test.go
@@ -55,6 +55,17 @@ func TestFindImageLeakMarker(t *testing.T) {
}
}
+func TestFindEnglishLeakWord(t *testing.T) {
+ t.Parallel()
+
+ if word, ok := findEnglishLeakWord("спокойна сцена"); ok || word != "" {
+ t.Fatalf("findEnglishLeakWord() = %q, %v, want no match", word, ok)
+ }
+ if word, ok := findEnglishLeakWord("page 1 of 5"); !ok || word != "page" {
+ t.Fatalf("findEnglishLeakWord() = %q, %v, want page match", word, ok)
+ }
+}
+
func TestComicStylesStayComic(t *testing.T) {
t.Parallel()
@@ -64,3 +75,26 @@ func TestComicStylesStayComic(t *testing.T) {
}
}
}
+
+func TestContainsLatinLetters(t *testing.T) {
+ t.Parallel()
+
+ if containsLatinLetters("Здравей") {
+ t.Fatal("containsLatinLetters() = true for Cyrillic text")
+ }
+ if !containsLatinLetters("Page 4 of 5") {
+ t.Fatal("containsLatinLetters() = false for Latin text")
+ }
+}
+
+func TestLocalizedStylePrompt(t *testing.T) {
+ t.Parallel()
+
+ got := localizedStylePrompt("classic American comic book with bold ink outlines, halftone dots, and primary colors", "Bulgarian", "Cyrillic")
+ if containsLatinLetters(got) {
+ t.Fatalf("localizedStylePrompt() = %q, want no Latin letters", got)
+ }
+ if got == "" {
+ t.Fatal("localizedStylePrompt() returned empty string")
+ }
+}