Files
hakorune/tests/fixtures/joinir/v0_skip_ws_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
1.3 KiB
Plaintext

{"version":0,"entry":0,"functions":[{"id":0,"name":"skip","params":[3000],"exit_cont":null,"body":[{"type":"compute","op":{"kind":"const","dst":3001,"value_type":"integer","value":0}},{"type":"compute","op":{"kind":"boxcall","dst":3002,"box":"StringBox","method":"length","args":[3000]}},{"type":"call","func":1,"args":[3000,3001,3002],"k_next":null,"dst":null}]},{"id":1,"name":"loop_step","params":[4000,4001,4002],"exit_cont":null,"body":[{"type":"compute","op":{"kind":"compare","dst":4003,"op":"ge","lhs":4001,"rhs":4002}},{"type":"jump","cont":0,"args":[4001],"cond":4003},{"type":"compute","op":{"kind":"const","dst":4007,"value_type":"integer","value":1}},{"type":"compute","op":{"kind":"binop","dst":4006,"op":"add","lhs":4001,"rhs":4007}},{"type":"compute","op":{"kind":"boxcall","dst":4004,"box":"StringBox","method":"substring","args":[4000,4001,4006]}},{"type":"compute","op":{"kind":"const","dst":4010,"value_type":"string","value":" "}},{"type":"compute","op":{"kind":"compare","dst":4005,"op":"eq","lhs":4004,"rhs":4010}},{"type":"compute","op":{"kind":"const","dst":4011,"value_type":"bool","value":false}},{"type":"compute","op":{"kind":"compare","dst":4012,"op":"eq","lhs":4005,"rhs":4011}},{"type":"jump","cont":1,"args":[4001],"cond":4012},{"type":"call","func":1,"args":[4000,4006,4002],"k_next":null,"dst":null}]}]}