test: Phase 100 mutable accumulator fixture + smoke (numeric validation)

- Add apps/tests/phase100_mutable_accumulator_min.hako
  * Pattern2 with break (if i >= 3 { break })
  * Two accumulators: out = out + ch (string), count = count + 1 (integer)
  * print(count) for stable numeric output
- Add phase100_mutable_accumulator_vm.sh smoke test
  * HAKO_JOINIR_STRICT=1 validation
  * Numeric-only output extraction (expected: 3)
- Regression: all phase100/96/94 tests pass

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-17 06:10:59 +09:00
parent 468977e9b3
commit 536e6280c5
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
# Phase 100 P2 - Mutable Accumulator (VM backend)
# Tests: out = out + ch (string accumulator) and count = count + 1 (integer accumulator)
HAKO_FILE="apps/tests/phase100_mutable_accumulator_min.hako"
BACKEND="vm"
EXPECTED_OUTPUT="3"
ACTUAL_OUTPUT=$(HAKO_JOINIR_STRICT=1 ./target/release/hakorune --backend "$BACKEND" "$HAKO_FILE" 2>&1 | grep -E '^[0-9]+$')
if [ "$ACTUAL_OUTPUT" = "$EXPECTED_OUTPUT" ]; then
echo "✅ PASS: phase100_mutable_accumulator_vm"
exit 0
else
echo "❌ FAIL: phase100_mutable_accumulator_vm"
echo "Expected:"
echo "$EXPECTED_OUTPUT"
echo "Got:"
echo "$ACTUAL_OUTPUT"
echo "---Full output (last 80 lines):---"
HAKO_JOINIR_STRICT=1 ./target/release/hakorune --backend "$BACKEND" "$HAKO_FILE" 2>&1 | tail -n 80
exit 1
fi