merge from main

This commit is contained in:
WindSoilder 2024-11-17 20:16:18 +08:00
parent d6a4267fd4
commit 18b48e1349

View File

@ -148,3 +148,14 @@ fn def_should_not_mutate_mut() {
assert!(actual.err.contains("capture of mutable variable"));
assert!(!actual.status.success())
}
#[test]
fn mut_with_bad_syntax_raises_parse_error() {
let actual = nu!("let x = 3; $x = 4");
assert!(actual
.err
.contains("parser::assignment_requires_mutable_variable"));
let actual = nu!("mut x = 3; x = 5");
assert!(actual.err.contains("parser::assignment_requires_variable"));
}