Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Merged
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
18 changes: 18 additions & 0 deletions page_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package spindle

import (
"fmt"
"math"
"testing"
)

Expand Down Expand Up @@ -216,6 +217,23 @@ func TestCursorValuesInvalidJSON(t *testing.T) {
}
}

func TestSetNextCursorMarshalError(t *testing.T) {
t.Parallel()

p := &PageInfo{Limit: 10}
result := p.SetNextCursor(map[string]any{"bad": math.NaN()})

if result != p {
t.Error("SetNextCursor should return the same PageInfo on error")
}
if p.HasMore {
t.Error("HasMore should remain false on marshal error")
}
if p.NextCursor != "" {
t.Errorf("NextCursor = %q, want empty on marshal error", p.NextCursor)
}
}

func TestNextCursorURL(t *testing.T) {
t.Parallel()

Expand Down