test: #698 — behavioral parity tests for argon2 + ethers integrations#760
Merged
Merged
Conversation
Converts deterministic entries from `test_ffi_surface_stdlib_integrations.ts` into focused behavioral parity fixtures, per the follow-up to #694. - `test_parity_argon2.ts` + expected output: round-trip `argon2.hash` / `argon2.verify` (async path — the only one wired in the dispatch table) with random-salt shape assertions. - `test_parity_ethers.ts` + expected output: deterministic helpers `getAddress`, `parseEther`/`formatEther`, `parseUnits`/`formatUnits`. - Adds `@covers` block to `test_parity_crypto.ts` for the crypto/webcrypto/crypto_e2e FFI surface it already exercises (digest, hash, hmac-via-pbkdf2/hkdf, subtle.sign/verify). Both new fixtures use the `test-parity/expected/` mechanism: Perry routes the npm-style imports to its bundled `perry-ext-*` wrappers, but Node can't load the same names without `node_modules`, so they fall through to the stored expected-output comparison. After `./test-coverage/regen_ts_surface_inventory.py`: - stdlib integrations inventory: 156 → 138 unique FFI names. - `./test-coverage/audit.sh --markdown` still reports 100% TS FFI coverage.
b26f337 to
6a796e3
Compare
proggeramlug
added a commit
to Lebei2046/perry
that referenced
this pull request
May 14, 2026
…docs (v0.5.909) Maintainer fold-in on top of @Lebei2046's libDirs feature: - link.rs: emit /LIBPATH:<dir> on is_windows (MSVC link.exe) instead of -L<dir>, mirroring the existing libs loop's MSVC/Unix split. - resolve.rs: anchor relative libDirs entries to package_dir via package_dir.join(p), matching swift_sources / metal_sources. Field type is now Vec<PathBuf>. - compile.rs: doc-comment on the new field. - manifest-v1.md: row added for libDirs. - resolve.rs: two new tests in manifest_parse_tests covering package_dir anchoring + empty-by-default behavior. - Cargo.toml / Cargo.lock / CLAUDE.md / CHANGELOG.md: 0.5.908 → 0.5.909 (renumbered to follow PerryTS#760 which took 0.5.908 mid-review).
proggeramlug
added a commit
that referenced
this pull request
May 14, 2026
* feat: add libDirs support Add support for specifying library search paths in native library target configurations via the new `libDirs` field in package.json. Changes: - Add `lib_dirs` field to TargetNativeConfig - Parse `libDirs` from package.json - Add `-L` flags for libDirs before linking * chore(libDirs): MSVC /LIBPATH branch + package_dir anchoring + tests/docs (v0.5.909) Maintainer fold-in on top of @Lebei2046's libDirs feature: - link.rs: emit /LIBPATH:<dir> on is_windows (MSVC link.exe) instead of -L<dir>, mirroring the existing libs loop's MSVC/Unix split. - resolve.rs: anchor relative libDirs entries to package_dir via package_dir.join(p), matching swift_sources / metal_sources. Field type is now Vec<PathBuf>. - compile.rs: doc-comment on the new field. - manifest-v1.md: row added for libDirs. - resolve.rs: two new tests in manifest_parse_tests covering package_dir anchoring + empty-by-default behavior. - Cargo.toml / Cargo.lock / CLAUDE.md / CHANGELOG.md: 0.5.908 → 0.5.909 (renumbered to follow #760 which took 0.5.908 mid-review). --------- Co-authored-by: Ralph Küpper <ralph.kuepper@skelpo.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.
Summary
Follow-up to #694, addressing #698. Converts deterministic entries from
test_ffi_surface_stdlib_integrations.tsinto focused behavioral parity fixtures.Changes
test_parity_argon2.ts+ expected output — round-tripargon2.hash/argon2.verifywith random-salt shape assertions. Only the async path is wired in Perry'sNativeModSigtable, so this covers the two FFI entries that are reachable end-to-end (js_argon2_hash,js_argon2_verify).test_parity_ethers.ts+ expected output — deterministic numeric/address helpers:getAddress(EIP-55 checksum),parseEther/formatEther,parseUnits/formatUnitsat 6- and 9-decimal positions. Covers the fivejs_ethers_*helpers that are pure functions of their inputs.test_parity_crypto.ts— adds a@coversblock declaring the crypto/webcrypto/crypto_e2e FFI surface it already exercises vianode:cryptoandcrypto.subtle(digest, hash, pbkdf2/hkdf, subtle.sign/verify).test-coverage/COVERAGE.mdandtest_ffi_surface_*inventory files.Both new fixtures use the
test-parity/expected/mechanism: Perry routes the npm-style imports to its bundledperry-ext-*wrappers, but Node can't load the same names withoutnode_modules, so they fall through to the stored expected-output comparison.Scope notes
I drafted fixtures for
jsonwebtoken,bcrypt, andcheerioas well, but each exposed pre-existing bugs in the dispatch layer that are out of scope here:jsonwebtoken.sign—NativeModSigpassespayload/secretasNA_F64(NaN-boxed) butjs_jwt_signreads them as*const StringHeader, producing a garbage token (calling-convention mismatch — same shape as the argon2.hash(password) receives null StringHeader at the FFI boundary #591 argon2 fix that landed earlier).bcrypt.hash— return value is reported astypeof === "object"in user code (compareround-trips correctly, but.startsWith(...)on the hash fails).cheerio—$.select(...)returns a bare-number handle, so.length()/.first()etc. fail with(number).method is not a functionat the prototype check.These should each get their own follow-up issue. For now they stay listed in
test_ffi_surface_stdlib_integrations.ts. Service-backed integrations (MongoDB, MySQL, PG, ioredis, Nodemailer, Sharp) also remain in the inventory pending the local-container / opt-in test setup described in #698.Inventory delta
test_ffi_surface_stdlib_integrations.ts: 156 → 138 unique FFI names (-18)../test-coverage/audit.sh --markdown: still 100% TS FFI surface coverage.Test plan
./test-coverage/regen_ts_surface_inventory.py./test-coverage/audit.sh --markdownreports 100% TS coverage./run_parity_tests.sh --filter test_parity_argon2→ PASS (expected-output)./run_parity_tests.sh --filter test_parity_ethers→ PASS (expected-output)./run_parity_tests.sh --filter test_ffi_surface→ 5/5 PASSChecklist