From b23d23f11f106ecdf6b0cf4a8c15d684ba8a108a Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Wed, 17 Dec 2025 04:25:57 +0900 Subject: [PATCH] test: Phase 99 extend next_non_ws to 3 cases (VM+LLVM) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- apps/tests/phase96_json_loader_next_non_ws_min.hako | 5 +++-- .../apps/phase96_json_loader_next_non_ws_vm.sh | 8 ++++---- .../integration/apps/phase97_next_non_ws_llvm_exe.sh | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/tests/phase96_json_loader_next_non_ws_min.hako b/apps/tests/phase96_json_loader_next_non_ws_min.hako index f531eb46..12477d0c 100644 --- a/apps/tests/phase96_json_loader_next_non_ws_min.hako +++ b/apps/tests/phase96_json_loader_next_non_ws_min.hako @@ -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" } } diff --git a/tools/smokes/v2/profiles/integration/apps/phase96_json_loader_next_non_ws_vm.sh b/tools/smokes/v2/profiles/integration/apps/phase96_json_loader_next_non_ws_vm.sh index 381e946d..f4824d43 100644 --- a/tools/smokes/v2/profiles/integration/apps/phase96_json_loader_next_non_ws_vm.sh +++ b/tools/smokes/v2/profiles/integration/apps/phase96_json_loader_next_non_ws_vm.sh @@ -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)) diff --git a/tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh b/tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh index 13677f5d..17ed1e9c 100644 --- a/tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh +++ b/tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh @@ -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):"