fix(evaluator): handle non-boolean test results gracefully instead of panicking (#1941)#1988
Open
dusterbloom wants to merge 2 commits into
Open
fix(evaluator): handle non-boolean test results gracefully instead of panicking (#1941)#1988dusterbloom wants to merge 2 commits into
dusterbloom wants to merge 2 commits into
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1941
The Rust evaluator panics with
Expected booleanwhen a testdefinition returns a non-bool value (e.g.,
val ignoredTest = 1).The TypeScript evaluator handles this correctly by marking such
tests as
ignored.Changes
Value::is_bool()method to check value type before conversiontester.rsto checkis_bool()beforeas_bool(), marking non-boolean results asTestStatus::Ignoredinstead of panickingignoredTestfixture toevaluator/fixtures/runs.qntnon_bool_test_is_ignoredtest caseTesting
quint test examples/language-features/counters.qntnow shows1 ignoredinstead of[QNT516] Rust evaluator exited with code 101AI Assistance
This PR was developed with AI assistance (Hermes Agent + Claude), as permitted by CONTRIBUTING.md.