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:
@ -24,8 +24,9 @@ static box Main {
|
||||
|
||||
main() {
|
||||
// Input mirrors MiniJsonLoader.next_non_ws
|
||||
print(next_non_ws(" " + " " + "hi")) // expect 2
|
||||
print(next_non_ws(" " + "\t")) // expect -1
|
||||
print(next_non_ws(" " + " " + "hi")) // expect 2
|
||||
print(next_non_ws(" " + "\t")) // expect -1
|
||||
print(next_non_ws("\n" + "\r" + "\t" + "X")) // expect 3 (mixed newline/CR/tab)
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,13 +27,13 @@ if [ "$EXIT_CODE" -eq 124 ]; then
|
||||
echo "[FAIL] hakorune timed out (>${RUN_TIMEOUT_SECS}s)"
|
||||
FAIL_COUNT=$((FAIL_COUNT + 1))
|
||||
elif [ "$EXIT_CODE" -eq 0 ]; then
|
||||
EXPECTED=$'2\n-1'
|
||||
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 2 | paste -sd '\n' - | tr -d '\r')
|
||||
EXPECTED=$'2\n-1\n3'
|
||||
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 3 | paste -sd '\n' - | tr -d '\r')
|
||||
if [ "$CLEAN" = "$EXPECTED" ]; then
|
||||
echo "[PASS] Output verified: 2 then -1"
|
||||
echo "[PASS] Output verified: 2, -1, then 3"
|
||||
PASS_COUNT=$((PASS_COUNT + 1))
|
||||
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 "$OUTPUT" | tail -n 50 || true
|
||||
FAIL_COUNT=$((FAIL_COUNT + 1))
|
||||
|
||||
@ -95,14 +95,14 @@ if [ "$EXIT_CODE" -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 2 | tr -d '\r')
|
||||
EXPECTED=$'2\n-1'
|
||||
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 3 | tr -d '\r')
|
||||
EXPECTED=$'2\n-1\n3'
|
||||
|
||||
echo "[INFO] CLEAN output:"
|
||||
echo "$CLEAN"
|
||||
|
||||
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
|
||||
echo "[FAIL] Output mismatch"
|
||||
echo "[INFO] Raw output (tail):"
|
||||
|
||||
Reference in New Issue
Block a user