Files
hakorune/tests/fixtures/joinir/v0_funcscanner_append_defs_min.jsonir
nyash-codex de16ff9b7f feat(joinir): Phase 30.x jsonir v0 snapshot tests
Implement JSON snapshot testing for JoinIR regression detection.

Implementation:
- tests/fixtures/joinir/v0_*.jsonir: 6 snapshot fixtures for minimal JoinIR cases
- src/tests/joinir_json_min.rs: Added 6 snapshot comparison tests

Fixtures:
- v0_skip_ws_min.jsonir (1338 bytes)
- v0_funcscanner_trim_min.jsonir (4484 bytes)
- v0_funcscanner_append_defs_min.jsonir (988 bytes)
- v0_stage1_usingresolver_min.jsonir (987 bytes)
- v0_stageb_body_min.jsonir (1074 bytes)
- v0_stageb_funcscanner_min.jsonir (962 bytes)

Usage:
  # Run snapshot tests
  NYASH_JOINIR_SNAPSHOT_TEST=1 cargo test --release joinir_json_v0_

  # Regenerate fixtures (after intentional changes)
  NYASH_JOINIR_SNAPSHOT_TEST=1 NYASH_JOINIR_SNAPSHOT_GENERATE=1 cargo test --release joinir_json_v0_

Purpose:
- Fix current JoinIR shape as v0 baseline (pre-generic state)
- Detect unintended regressions during genericization
- Allow intentional fixture updates when design changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 10:19:02 +09:00

1 line
988 B
Plaintext

{"version":0,"entry":0,"functions":[{"id":0,"name":"append_defs_entry","params":[9000,9001,9002],"exit_cont":null,"body":[{"type":"compute","op":{"kind":"const","dst":9010,"value_type":"integer","value":0}},{"type":"call","func":1,"args":[9000,9001,9002,9010],"k_next":null,"dst":null}]},{"id":1,"name":"loop_step","params":[10000,10001,10002,10003],"exit_cont":null,"body":[{"type":"compute","op":{"kind":"compare","dst":10010,"op":"ge","lhs":10003,"rhs":10002}},{"type":"jump","cont":0,"args":[],"cond":10010},{"type":"compute","op":{"kind":"boxcall","dst":10011,"box":"ArrayBox","method":"get","args":[10001,10003]}},{"type":"compute","op":{"kind":"boxcall","dst":null,"box":"ArrayBox","method":"push","args":[10000,10011]}},{"type":"compute","op":{"kind":"const","dst":10013,"value_type":"integer","value":1}},{"type":"compute","op":{"kind":"binop","dst":10012,"op":"add","lhs":10003,"rhs":10013}},{"type":"call","func":1,"args":[10000,10001,10002,10012],"k_next":null,"dst":null}]}]}