(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestDecodeCursorWrongSecret(t *testing.T) { |
| 88 | type cur struct { |
| 89 | A string `json:"a"` |
| 90 | } |
| 91 | enc := EncodeMust(t, testSecret, cur{A: "x"}) |
| 92 | var out cur |
| 93 | if err := DecodeCursor([]string{"a-different-secret-value-here-3232"}, enc, &out); err != ErrInvalidCursor { |
| 94 | t.Fatalf("wrong secret: want ErrInvalidCursor, got %v", err) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func TestDecodeCursorOldUnsignedFormatRejected(t *testing.T) { |
| 99 | // An old-style cursor is plain base64url(json) with no "." + signature. |
nothing calls this directly
no test coverage detected