Add property-style tests for base64 padding and uuidv7 shifts#66
Draft
NikolayS wants to merge 1 commit into
Draft
Add property-style tests for base64 padding and uuidv7 shifts#66NikolayS wants to merge 1 commit into
NikolayS wants to merge 1 commit into
Conversation
Recent fixes exposed input-boundary gaps in the base64/base64url decode
path and in uuidv7(interval). This extends the regression suite with
property-style coverage that guards those boundaries:
strings: encode/decode round-trip identity for both base64 and base64url
across input lengths 0..8 (every padding phase, len % 3 in {0,1,2}), plus
a padding/truncation rejection matrix covering each unpadded
trailing-group length (1/2/3 chars) x variant. base64 rejects every
unpadded partial group; base64url accepts 2- and 3-char remainders but
rejects a lone 1-char remainder and misplaced "=" padding. This locks in
the truncation rules restored in commit 1f41403.
uuid: a monotone-ordering property asserting that strictly increasing
uuidv7(interval) shifts yield strictly increasing (sortable) UUID values,
comparing the uuid values themselves rather than only the extracted
timestamps. Complements the out-of-range and infinite-interval rejection
tests added in commit 7575215.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PtxA6B4d47ietk5dGsseuP
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds property-style regression tests in
src/test/regressthat close input-boundary gaps around two recent fixes:=padding acceptance for plain base64; the fix re-gates the relaxed rule on the url variant.Why
The commits above each shipped a single targeted test. This adds broader property coverage so the restored boundaries stay locked in:
strings(base64 / base64url):encode(decode(encode(x))) = xfor both variants across input lengths 0..8, covering every padding phase (len % 3in {0,1,2}). Uses a deterministic byte pattern, so output is stable.invalid base64 end sequence); base64url accepts 2- and 3-char remainders but rejects a lone 1-char remainder; misplaced=padding (unexpected "=" while decoding ...) is rejected in both.uuid(uuidv7 interval):uuidv7(interval)shifts yield strictly increasing (sortable) UUID values, comparing the uuid values themselves rather than only the extracted timestamps. Complements the infinite-interval and out-of-range rejection tests from 7575215.All uuidv7 tests assert properties/errors only — never literal random UUID values.
Test evidence
Built with
meson setup build --buildtype=debug -Dcassert=true -Dtap_tests=enabledandninja -C build.Full
parallel_schedulerun:strings(test 22) anduuid(test 16) bothok,regression.diffsempty.Notes
Test-only change: 4 files, +188 lines (
sql/strings.sql,sql/uuid.sql, and matchingexpected/*.out).Closes #60
🤖 Generated with Claude Code
https://claude.ai/code/session_01PtxA6B4d47ietk5dGsseuP
Generated by Claude Code