Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure error in else is forwarded appropriately #7411

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
merelymyself committed Dec 9, 2022
commit bbac1b4dbd4c9a4492c2d81bc4885c7cf56e247c
10 changes: 8 additions & 2 deletions crates/nu-parser/tests/test_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,14 @@ mod input_types {
add_declations(&mut engine_state);

let mut working_set = StateWorkingSet::new(&engine_state);
let (_, err) = parse(&mut working_set, None, b"if false { 'a' } else { $foo }", true, &[]);

let (_, err) = parse(
&mut working_set,
None,
b"if false { 'a' } else { $foo }",
true,
&[],
);

let err = err.unwrap();

assert!(matches!(err, ParseError::VariableNotFound(_)));
Expand Down