Skip to content

test(parity): expected-exit=1 for 3 intentional-throw expected-output tests#4271

Merged
proggeramlug merged 1 commit into
mainfrom
fix-parity-expected-exit
Jun 3, 2026
Merged

test(parity): expected-exit=1 for 3 intentional-throw expected-output tests#4271
proggeramlug merged 1 commit into
mainfrom
fix-parity-expected-exit

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Problem

run_parity_tests.sh compares an expected-output test's process exit code
against test-parity/expected-exit/<name>.txt, defaulting to 0 when that file
is absent. Three Perry-specific expected-output tests intentionally end by
throwing a TypeError (verifying spec behavior) — their committed
test-parity/expected/<name>.txt snapshots already capture the thrown error —
but had no expected-exit entry. So the harness expected exit 0 while
Perry (correctly, matching node --experimental-strip-types) exits 1,
producing a false parity failure even though Perry's stdout+error and exit
already match Node.

Affected: test_issue_462_nullish_property_access,
test_issue_510_primitive_method_typeerror,
test_decorators_replacement_unsupported.

Fix

Add test-parity/expected-exit/<name>.txt = 1 for all three.

No runtime/compiler change — Perry's behavior was already correct; this only
corrects the harness's expected exit code for these throw-on-purpose cases.

Verification

Each now passes:

./run_parity_tests.sh --filter test_issue_462_nullish_property_access  → PASS (expected-output)
./run_parity_tests.sh --filter test_issue_510_primitive_method_typeerror → PASS (expected-output)
./run_parity_tests.sh --filter test_decorators_replacement_unsupported → PASS (expected-output)

… tests

run_parity_tests.sh defaults an expected-output test's expected exit code to 0
when test-parity/expected-exit/<name>.txt is absent. test_issue_462,
test_issue_510, and test_decorators_replacement_unsupported intentionally throw
a TypeError (their expected/ snapshots already capture the error) but lacked an
expected-exit entry, so the harness expected exit 0 while Perry correctly exits
1 (matching node). Add expected-exit=1 for all three; each now passes via
run_parity_tests.sh --filter. No compiler/runtime change. Bumps to 0.5.1114.
@proggeramlug proggeramlug merged commit bfc4cf6 into main Jun 3, 2026
11 checks passed
@proggeramlug proggeramlug deleted the fix-parity-expected-exit branch June 3, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant