Skip to content

Fix the const_switch_rejects_a_value_that_is_not_a_bool test on main - #19645

Merged
fdncred merged 1 commit into
nushell:mainfrom
fdncred:fix_const_switch_test
Nov 23, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
fdncred:fix_const_switch_test

Conversation

@fdncred

@fdncred fdncred commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Description

repl::test_engine::const_switch_rejects_a_value_that_is_not_a_bool fails on main (1dc849d), and so does every PR's root test job. #19638 added the test. Two PRs merged a few minutes before it changed what the test expects, and each of the three passed CI on its own base:

The test covers the check #19638 added to const evaluation, so it needs an argument the parser can't type. It now passes ($r | get a). get returns any, so the parser lets it through and the const evaluation rejects it. The test matches the CantConvert inside ParseTimeEval, the same way builtin_switch_rejects_a_value_that_is_not_a_bool matches its error.

User-facing changes (Release notes)

Additional notes

nushell#19634 made the parser type `$r.a`, so it rejects `--chars=$r.a` before
const evaluation runs, and nushell#19635 moved parse-time evaluation errors into
ParseError::ParseTimeEval. Pass `($r | get a)`, which the parser types as
any, so the test still covers the const evaluation check from nushell#19638, and
match the CantConvert inside ParseTimeEval.
@fdncred fdncred added tests issues to add tests or fix tests notes:mention Noted in "Hall of Fame" section notes:ready Indicates Ready for Release notes labels Nov 23, 2026
@fdncred
fdncred merged commit 798f9de into nushell:main Nov 23, 2026
15 checks passed
@fdncred
fdncred deleted the fix_const_switch_test branch November 23, 2026 16:35
@github-actions github-actions Bot added this to the v0.118.0 milestone Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:mention Noted in "Hall of Fame" section notes:ready Indicates Ready for Release notes tests issues to add tests or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant