Repository navigation
test(u4): strengthen pair-to-byte coverage - #239
Merged
RobinLinus merged 1 commit intoSep 25, 2026
Merged
Conversation
brenorb
added a commit
to brenorb/bitcoin-scripts
that referenced
this pull request
Sep 28, 2026
…licts Robin Linus requested integrating current main while retaining solving-bitcoin#239's checked/unchecked pair-packing and range-error tests on stack.rs alongside this PR's word-transfer and lookup-lifecycle documentation and tests. - knowledge/catalog.json: combined the two independent stack_contract sentence additions (main's popcount wording, this PR's transfer/ lookup wording); kept every record and configuration from both sides (117 records, 292 configurations; main's 283 configs + this PR's 9 new ones). - src/arithmetic/u4/mod.rs: re-sorted the module list, keeping every `pub mod` from both sides. - src/arithmetic/u4/stack.rs: kept both `use` imports (this PR's execute_script_with_inputs_strict and main's bitcoin_scriptexec:: ExecError, the latter needed by solving-bitcoin#239's tests). All 24 tests in the module (main's 13 plus this PR's 11 new transfer tests) survive; the PR's now-superseded `packs_all_checked_nibble_pairs` is correctly dropped in favor of main's renamed/expanded `packs_all_nibble_pairs`, per instruction to keep main's pair-packing functions unchanged. - tests/primitive_metrics.rs: both sides had appended new tests at the same insertion point; spliced this PR's 4 new u4 metric tests ahead of main's 4 new u32 metric tests, preserving all fns from both sides (206 main + 4 new = 210 total, verified by name-set comparison). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Carry the useful validation from superseded PR #80 into the canonical pair-to-byte implementation from #33.\n\n- Exercise all 256 nibble pairs in both checked and unchecked modes.\n- Make malformed-input coverage consume the output and assert the range-check error instead of relying on clean-stack failure.\n- Preserve the existing surrounding-state assertion.\n\nFocused tests pass; formatting and knowledge-base validation pass.