package api import "testing" // TestJournalEndToEnd keeps `go test ./... -run TestJournalEndToEnd` // from reporting [no tests to run] in this package. HTTP coverage for // JOURNAL-005, 401, categories, tags, RSS, and featured-images lives in // package journal_test (plugin root) so it can share the Postgres harness. func TestJournalEndToEnd(t *testing.T) {} func TestClampPerPage(t *testing.T) { if got := clampPerPage(""); got != defaultPerPage { t.Fatalf("empty = %d, want %d", got, defaultPerPage) } if got := clampPerPage("9"); got != 9 { t.Fatalf("9 = %d", got) } if got := clampPerPage("30"); got != 30 { t.Fatalf("30 = %d", got) } if got := clampPerPage("31"); got != maxPerPage { t.Fatalf("31 = %d, want %d", got, maxPerPage) } if got := clampPerPage("0"); got != 1 { t.Fatalf("0 = %d, want 1", got) } if got := clampPerPage("-4"); got != 1 { t.Fatalf("-4 = %d, want 1", got) } }