summaryrefslogtreecommitdiff
path: root/internal/comic/comic_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/comic/comic_test.go')
-rw-r--r--internal/comic/comic_test.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/comic/comic_test.go b/internal/comic/comic_test.go
index 319c7b2..b1ea5ab 100644
--- a/internal/comic/comic_test.go
+++ b/internal/comic/comic_test.go
@@ -47,11 +47,25 @@ func TestBuildPanelLayoutUsesFallbackExcerpt(t *testing.T) {
t.Parallel()
got := buildPanelLayout("one two three four five", nil)
- if !strings.Contains(got, "Откъс от историята") {
+ if !strings.Contains(got, "Story excerpt") {
t.Fatalf("buildPanelLayout() = %q", got)
}
}
+func TestComicOutputDirDoesNotDuplicateComicsSegment(t *testing.T) {
+ t.Parallel()
+
+ if got, want := comicOutputDir("comics", "slug"), filepath.Join("comics", "slug"); got != want {
+ t.Fatalf("comicOutputDir() = %q, want %q", got, want)
+ }
+ if got, want := comicOutputDir(".", "slug"), filepath.Join(".", "comics", "slug"); got != want {
+ t.Fatalf("comicOutputDir() = %q, want %q", got, want)
+ }
+ if got, want := comicOutputDir("/tmp/out", "slug"), filepath.Join("/tmp/out", "comics", "slug"); got != want {
+ t.Fatalf("comicOutputDir() = %q, want %q", got, want)
+ }
+}
+
func TestCopyGalleryPNGsToComicsGallery(t *testing.T) {
t.Parallel()