Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/deck/deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func (d Deck) ValidateWithMaxPages(configuredMaxPages int) error {
configuredMaxPages = maxPages
}
if len(d.Pages) < minPages || len(d.Pages) > configuredMaxPages {
return fmt.Errorf("deck must contain %d to %d pages", minPages, configuredMaxPages)
return fmt.Errorf("deck must contain %d to %d pages (got %d)", minPages, configuredMaxPages, len(d.Pages))
}
if d.Pages[0].Variant != "cover" {
return fmt.Errorf("first page must use cover variant")
Expand Down
4 changes: 2 additions & 2 deletions internal/deck/deck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestDeckFromJSONRejectsTooFewPages(t *testing.T) {
if err == nil {
t.Fatalf("FromJSON() error = nil, want non-nil")
}
if !strings.Contains(err.Error(), "must contain 3 to 12 pages") {
if !strings.Contains(err.Error(), "must contain 3 to 12 pages (got 2)") {
t.Fatalf("error = %v", err)
}
}
Expand All @@ -207,7 +207,7 @@ func TestDeckFromJSONRejectsThirteenPages(t *testing.T) {
if err == nil {
t.Fatalf("FromJSON() error = nil, want non-nil")
}
if !strings.Contains(err.Error(), "deck must contain 3 to 12 pages") {
if !strings.Contains(err.Error(), "deck must contain 3 to 12 pages (got 13)") {
t.Fatalf("error = %v", err)
}
}
Expand Down