Skip to content

fix(evaluator): handle non-boolean test results gracefully instead of panicking (#1941)#1988

Open
dusterbloom wants to merge 2 commits into
quint-co:mainfrom
dusterbloom:fix/non-bool-test-panic
Open

fix(evaluator): handle non-boolean test results gracefully instead of panicking (#1941)#1988
dusterbloom wants to merge 2 commits into
quint-co:mainfrom
dusterbloom:fix/non-bool-test-panic

Conversation

@dusterbloom

Copy link
Copy Markdown

Fixes #1941

The Rust evaluator panics with Expected boolean when a test
definition returns a non-bool value (e.g., val ignoredTest = 1).
The TypeScript evaluator handles this correctly by marking such
tests as ignored.

Changes

  • Add Value::is_bool() method to check value type before conversion
  • Update tester.rs to check is_bool() before as_bool(), marking non-boolean results as TestStatus::Ignored instead of panicking
  • Add ignoredTest fixture to evaluator/fixtures/runs.qnt
  • Add non_bool_test_is_ignored test case

Testing

  • All 5 evaluator tests pass (4 existing + 1 new)
  • Integration test: quint test examples/language-features/counters.qnt now shows 1 ignored instead of [QNT516] Rust evaluator exited with code 101

AI Assistance

This PR was developed with AI assistance (Hermes Agent + Claude), as permitted by CONTRIBUTING.md.

… panicking (quint-co#1941)

The Rust evaluator panicked with 'Expected boolean' when a test
definition returned a non-bool value, e.g. `val ignoredTest = 1`.
The TypeScript evaluator handles this correctly by marking such
tests as ignored.

Changes:
- Add Value::is_bool() to check value type before conversion
- Update tester to check is_bool() before as_bool(), marking
  non-boolean results as ignored instead of panicking
- Add ignoredTest fixture and non_bool_test_is_ignored test
- All 5 evaluator tests pass, no regressions

Closes quint-co#1941
The non-boolean test panic fix (quint-co#1941) makes counters.qnt run cleanly
under the Rust backend, so the examples dashboard no longer needs the
failing marker referencing that issue.
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.

Rust evaluator panics when a test definition returns a non-boolean value

1 participant