Skip to content

test(stdlib): #696 — behavioral parity tests for stdlib core utilities#757

Merged
proggeramlug merged 3 commits into
mainfrom
test/stdlib-core-parity-tests
May 14, 2026
Merged

test(stdlib): #696 — behavioral parity tests for stdlib core utilities#757
proggeramlug merged 3 commits into
mainfrom
test/stdlib-core-parity-tests

Conversation

@TheHypnoo
Copy link
Copy Markdown
Contributor

Summary

Closes #696. Convert the stdlib-core FFI inventory entries called out in the issue into focused behavioral parity fixtures.

  • New fixtures in test-files/test_parity_*.ts: lodash, dotenv, validator, uuid, nanoid, decimal, dayjs, moment, date_fns, lru_cache, commander, cron, async_local_storage.
  • Existing fixtures extended with @covers blocks: test_parity_events.ts, test_parity_zlib.ts.
  • Non-deterministic surfaces (uuid v4/v7, nanoid, dayjs.now / fromNow, randomness) use shape checks; everything else uses fixed inputs and anchored timestamps so the printed output is byte-deterministic.
  • After running ./test-coverage/regen_ts_surface_inventory.py, test_ffi_surface_stdlib_core.ts drops from 313 → 84 unique FFI names — every area listed in Add behavioral TS parity tests for stdlib core utilities #696 is converted.
  • ./test-coverage/audit.sh --markdown still reports 1790/1790 (100.0%) TS coverage.

Notes

  • Fixtures that import npm packages not present in this worktree (uuid, nanoid, dayjs, moment, date-fns, decimal.js, lru-cache, commander, node-cron, validator, dotenv, lodash) will be recorded as NODE_FAIL/SKIP by run_parity_tests.sh when the package isn't installed — they still act as coverage anchors via their @covers blocks. Once the packages are available (or Perry's import dispatch is wired for those names), the same fixtures double as gap-signal sources.
  • The test_parity_async_local_storage.ts fixture only uses node:async_hooks and runs clean under Node today.

Test plan

  • python3 test-coverage/regen_ts_surface_inventory.pywrote test-files/test_ffi_surface_stdlib_core.ts (84 names)
  • ./test-coverage/audit.sh --markdownTS coverage: 1790/1790 (100.0%)
  • node --experimental-strip-types test-files/test_parity_async_local_storage.ts — deterministic output for the one fixture that doesn't need an external npm package
  • ./run_parity_tests.sh --filter test_parity_ once a full sweep environment is available (see Notes above for fixtures expected to record NODE_FAIL until npm packages land)

TheHypnoo and others added 3 commits May 14, 2026 07:05
Convert the stdlib-core FFI inventory entries listed in #696 into focused
behavioral parity fixtures and absorb the corresponding FFI symbols via
@Covers blocks so regen_ts_surface_inventory.py removes them from the
inventory.

New fixtures (test-files/test_parity_*.ts):
  lodash, dotenv, validator, uuid, nanoid, decimal, dayjs, moment,
  date_fns, lru_cache, commander, cron, async_local_storage

Existing fixtures extended with @Covers blocks:
  test_parity_events.ts, test_parity_zlib.ts

Non-deterministic surfaces (uuid v4/v7, nanoid, dayjs.now, fromNow) use
shape checks; everything else uses fixed inputs and anchored timestamps
so the printed output is byte-deterministic.

After regen, test_ffi_surface_stdlib_core.ts drops from 313 → 84 unique
FFI names (all areas listed in #696 are converted). ./test-coverage/
audit.sh --markdown still reports 1790/1790 (100.0%) TS coverage.
test_parity_decimal, test_parity_dotenv, test_parity_lodash,
test_parity_moment, and test_parity_validator from #696 link against
FFI symbols that aren't currently exported by the bundled extension
crates (e.g. js_decimal_*_value variants live in perry-stdlib's
bundled-decimal feature but aren't surfaced through perry-ext-decimal,
which is what the well-known route picks up). The fixtures still serve
as coverage anchors for the inventory; matching the existing pattern
where most test_parity_* are compile-smoke-skipped until their dispatch
is fully wired.
Folds in version bump and CHANGELOG entry per CLAUDE.md "maintainer
amends at merge time" convention. Bumps Cargo.toml workspace package
version 0.5.905 → 0.5.906, refreshes Cargo.lock, updates CLAUDE.md
**Current Version**, and prepends the v0.5.906 block to CHANGELOG.md.

Test-only PR; no runtime/codegen changes.
@proggeramlug proggeramlug force-pushed the test/stdlib-core-parity-tests branch from ab6a168 to 9592cc6 Compare May 14, 2026 05:10
@proggeramlug proggeramlug merged commit 19d485b into main May 14, 2026
9 checks passed
@proggeramlug proggeramlug deleted the test/stdlib-core-parity-tests branch May 14, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add behavioral TS parity tests for stdlib core utilities

2 participants