test: align Phase 107 object fixture expected output

This commit is contained in:
nyash-codex
2025-12-17 23:16:53 +09:00
parent 6a21382d44
commit 9fa2f5a8ad
3 changed files with 7 additions and 10 deletions

View File

@ -28,12 +28,11 @@ llvm_exe_ensure_plugins_or_fail || exit 1
INPUT_HAKO="$NYASH_ROOT/apps/tests/phase107_find_balanced_object_end_min.hako"
OUTPUT_EXE="$NYASH_ROOT/tmp/phase107_find_balanced_object_end_llvm_exe"
EXPECTED=$'1\n5'
EXPECTED=$'1\n3'
EXPECTED_LINES=2
LLVM_BUILD_LOG="/tmp/phase107_find_balanced_object_end_build.log"
if llvm_exe_build_and_run_numeric_smoke; then
test_pass "phase107_find_balanced_object_end_llvm_exe: output matches expected (1, 5)"
test_pass "phase107_find_balanced_object_end_llvm_exe: output matches expected (1, 3)"
else
exit 1
fi

View File

@ -25,13 +25,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=$'1\n5'
EXPECTED=$'1\n3'
CLEAN=$(printf "%s\n" "$OUTPUT" | grep -E '^-?[0-9]+$' | head -n 2 | paste -sd '\n' - | tr -d '\r')
if [ "$CLEAN" = "$EXPECTED" ]; then
echo "[PASS] Output verified: 1 then 5"
echo "[PASS] Output verified: 1 then 3"
PASS_COUNT=$((PASS_COUNT + 1))
else
echo "[FAIL] Unexpected output (expected lines: 1 then 5)"
echo "[FAIL] Unexpected output (expected lines: 1 then 3)"
echo "[INFO] output (tail):"
echo "$OUTPUT" | tail -n 60 || true
FAIL_COUNT=$((FAIL_COUNT + 1))
@ -52,4 +52,3 @@ else
test_fail "phase107_find_balanced_object_end_vm: $FAIL_COUNT test(s) failed"
exit 1
fi