fix(test): Update test_local_declarations_with_acc for Phase 56 MethodCall change

Phase 56 changed LoopFrontendBinding::for_array_filter() from
BoundExpr::Variable("n") to BoundExpr::MethodCall { arr, size }.

Updated test expectations:
- Changed from expecting Var type to Method type
- Added assertions for receiver structure (Var node with "arr")
- Added assertion for method name ("size")

Test result: All 8 loop_frontend_binding tests PASS

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-04 10:33:47 +09:00
parent 20f5b9a9c2
commit b7a421acc8

View File

@ -385,10 +385,15 @@ mod tests {
assert_eq!(acc_local["expr"]["type"], "NewBox");
assert_eq!(acc_local["expr"]["box_name"], "ArrayBox");
// n should reference the "n" variable (Var type)
// Phase 56: n should be arr.size() method call (not a Var anymore)
assert_eq!(n_local["name"], "n");
assert_eq!(n_local["expr"]["type"], "Var");
assert_eq!(n_local["expr"]["name"], "n");
assert_eq!(n_local["expr"]["type"], "Method");
assert_eq!(n_local["expr"]["method"], "size");
// receiver should be a simple Var node pointing to "arr"
let receiver = &n_local["expr"]["receiver"];
assert_eq!(receiver["type"], "Var");
assert_eq!(receiver["name"], "arr");
}
// Phase 52: receiver_to_json のテスト