mirror of
https://github.com/nushell/nushell.git
synced 2024-11-21 16:03:19 +01:00
merge from main
This commit is contained in:
parent
d6a4267fd4
commit
18b48e1349
@ -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"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user