test: Phase 99 extend next_non_ws to 3 cases (VM+LLVM)

3ケース固定:
- 既存: "  hi" → 2, " \t" → -1
- 新規: "\n\r\tX" → 3 (mixed newline/CR/tab)

VM+LLVM EXE parity完全対応

🤖 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 04:25:57 +09:00
parent 6d73fc3404
commit b23d23f11f
3 changed files with 10 additions and 9 deletions

View File

@ -24,8 +24,9 @@ static box Main {
main() { main() {
// Input mirrors MiniJsonLoader.next_non_ws // Input mirrors MiniJsonLoader.next_non_ws
print(next_non_ws(" " + " " + "hi")) // expect 2 print(next_non_ws(" " + " " + "hi")) // expect 2
print(next_non_ws(" " + "\t")) // expect -1 print(next_non_ws(" " + "\t")) // expect -1
print(next_non_ws("\n" + "\r" + "\t" + "X")) // expect 3 (mixed newline/CR/tab)
return "OK" return "OK"
} }
} }

View File

@ -27,13 +27,13 @@ if [ "$EXIT_CODE" -eq 124 ]; then
echo "[FAIL] hakorune timed out (>${RUN_TIMEOUT_SECS}s)" echo "[FAIL] hakorune timed out (>${RUN_TIMEOUT_SECS}s)"
FAIL_COUNT=$((FAIL_COUNT + 1)) FAIL_COUNT=$((FAIL_COUNT + 1))
elif [ "$EXIT_CODE" -eq 0 ]; then elif [ "$EXIT_CODE" -eq 0 ]; then
EXPECTED=$'2\n-1' EXPECTED=$'2\n-1\n3'
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 2 | paste -sd '\n' - | tr -d '\r') CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 3 | paste -sd '\n' - | tr -d '\r')
if [ "$CLEAN" = "$EXPECTED" ]; then if [ "$CLEAN" = "$EXPECTED" ]; then
echo "[PASS] Output verified: 2 then -1" echo "[PASS] Output verified: 2, -1, then 3"
PASS_COUNT=$((PASS_COUNT + 1)) PASS_COUNT=$((PASS_COUNT + 1))
else else
echo "[FAIL] Unexpected output (expected lines: 2 then -1)" echo "[FAIL] Unexpected output (expected lines: 2, -1, then 3)"
echo "[INFO] output (tail):" echo "[INFO] output (tail):"
echo "$OUTPUT" | tail -n 50 || true echo "$OUTPUT" | tail -n 50 || true
FAIL_COUNT=$((FAIL_COUNT + 1)) FAIL_COUNT=$((FAIL_COUNT + 1))

View File

@ -95,14 +95,14 @@ if [ "$EXIT_CODE" -ne 0 ]; then
exit 1 exit 1
fi fi
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 2 | tr -d '\r') CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 3 | tr -d '\r')
EXPECTED=$'2\n-1' EXPECTED=$'2\n-1\n3'
echo "[INFO] CLEAN output:" echo "[INFO] CLEAN output:"
echo "$CLEAN" echo "$CLEAN"
if [ "$CLEAN" = "$EXPECTED" ]; then if [ "$CLEAN" = "$EXPECTED" ]; then
test_pass "phase97_next_non_ws_llvm_exe: output matches expected (2, -1)" test_pass "phase97_next_non_ws_llvm_exe: output matches expected (2, -1, 3)"
else else
echo "[FAIL] Output mismatch" echo "[FAIL] Output mismatch"
echo "[INFO] Raw output (tail):" echo "[INFO] Raw output (tail):"