summaryrefslogtreecommitdiff
path: root/internal/comic/pdf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/comic/pdf_test.go')
-rw-r--r--internal/comic/pdf_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/comic/pdf_test.go b/internal/comic/pdf_test.go
new file mode 100644
index 0000000..79da814
--- /dev/null
+++ b/internal/comic/pdf_test.go
@@ -0,0 +1,35 @@
+package comic
+
+import "testing"
+
+func TestIsDINA4ClassPDFPresentation(t *testing.T) {
+ tests := []struct {
+ in string
+ want bool
+ }{
+ {"print", true},
+ {"PRINT", true},
+ {" book ", true},
+ {"book", true},
+ {"none", false},
+ {"", false},
+ {"fullbleed", false},
+ }
+ for _, tt := range tests {
+ if got := IsDINA4ClassPDFPresentation(tt.in); got != tt.want {
+ t.Errorf("IsDINA4ClassPDFPresentation(%q) = %v, want %v", tt.in, got, tt.want)
+ }
+ }
+}
+
+func TestIsBookPDFPresentation(t *testing.T) {
+ if !IsBookPDFPresentation("book") {
+ t.Fatal("IsBookPDFPresentation(book) = false")
+ }
+ if IsBookPDFPresentation("print") {
+ t.Fatal("IsBookPDFPresentation(print) = true, want false")
+ }
+ if IsBookPDFPresentation("none") {
+ t.Fatal("IsBookPDFPresentation(none) = true, want false")
+ }
+}