(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func TestDecodeCursorMultiSecretRotation(t *testing.T) { |
| 115 | type cur struct { |
| 116 | A string `json:"a"` |
| 117 | } |
| 118 | const secretA = "secret-A-padding-padding-padding-32" |
| 119 | const secretB = "secret-B-padding-padding-padding-32" |
| 120 | // Sign with B; verify against [A, B] — a rotation where B is the newest |
| 121 | // secret and A is still accepted. |
| 122 | enc := EncodeMust(t, secretB, cur{A: "rotated"}) |
| 123 | var out cur |
| 124 | if err := DecodeCursor([]string{secretA, secretB}, enc, &out); err != nil { |
| 125 | t.Fatalf("multi-secret verify: %v", err) |
| 126 | } |
| 127 | if out.A != "rotated" { |
| 128 | t.Fatalf("round-trip mismatch: got %+v", out) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func TestNewPageNullVsEmpty(t *testing.T) { |
| 133 | // No next cursor -> next_cursor is JSON null; nil items -> []. |
nothing calls this directly
no test coverage detected