mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 11:11:08 +02:00
Fix comment issue and shadowing issue (#501)
This commit is contained in:
17
src/tests.rs
17
src/tests.rs
@ -1249,3 +1249,20 @@ fn command_drop_column_1() -> TestResult {
|
||||
fn chained_operator_typecheck() -> TestResult {
|
||||
run_test("1 != 2 && 3 != 4 && 5 != 6", "true")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn proper_shadow() -> TestResult {
|
||||
run_test("let x = 10; let x = $x + 9; $x", "19")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn comment_multiline() -> TestResult {
|
||||
run_test(
|
||||
r#"def foo [] {
|
||||
let x = 1 + 2 # comment
|
||||
let y = 3 + 4 # another comment
|
||||
$x + $y
|
||||
}; foo"#,
|
||||
"10",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user