Add missing dcbor tests for Rust parity and fix ExactF64.exactFromU128#142
Merged
Conversation
Audited the TypeScript dcbor tests against bc-dcbor-rust (c76a15a, v0.25.2) and closed the remaining portable gaps: - walk: port test_walk_array, test_walk_tagged, test_walk_nested_structure, and test_edge_type_labels from src/walk.rs. - exact: cover ExactF32/ExactF64 from u128/i128, plus the f64 MIN_POSITIVE/MAX and i64 MAX/MIN-as-f64 and subnormal boundary cases. The new exact tests surfaced a divergence: ExactF64.exactFromU128 used a non-saturating round-trip and rejected u128::MAX, unlike Rust's saturating 'f as u128' (and unlike the sibling exactFromU64). Add saturateFloatToU128 and switch the method to the saturating round-trip so u128::MAX rounds to 2^128 and maps back, matching the reference.
- Bump all @bcts/* packages and the root from 1.0.0-beta.4 to 1.0.0-beta.5. - Add 1.0.0-beta.5 CHANGELOG entries (coordinated bump); dcbor notes the ExactF64.exactFromU128 saturating-round-trip fix and the new Rust-parity walk/exact tests carried on this branch. - Update the version badge in README. - Reformat 22 files that had drifted from Prettier style (union-type line wrapping). build, typecheck, lint, and format:check all pass.
The failing format:check was a prettier version drift: the lockfile is gitignored, so CI resolved prettier per the caret range (>=3.9.1 -> 3.9.4) while the files had been formatted with an older 3.8.x. 3.9 wraps multi-line union types differently, so CI re-flagged the 22 files. - Reformat the 22 affected files with prettier 3.9.4. - Pin prettier to an exact '3.9.4' (was '^3.9.1') so CI and local always use the same formatter and this can't drift again. format:check, build, typecheck, and lint all pass.
A newer vue-tsc (resolved from the caret range; the lockfile is gitignored, so CI drifts ahead of local) enforces that @click handlers return void. 62 idiomatic inline assignment handlers in envelope.vue and xid-builder.vue (e.g. @click="showX = true") were flagged as returning boolean/string. Wrap each in an arrow block — @click="() => { showX = true }" — so it returns void. Behavior-preserving: all are plain state assignments, none use $event. Full typecheck (26/26), lint, and format:check pass.
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.
The new exact tests surfaced a divergence: ExactF64.exactFromU128 used a non-saturating round-trip and rejected u128::MAX, unlike Rust's saturating 'f as u128' (and unlike the sibling exactFromU64). Add saturateFloatToU128 and switch the method to the saturating round-trip so u128::MAX rounds to 2^128 and maps back, matching the reference.