Fix comment issue and shadowing issue (#501)

This commit is contained in:
JT
2021-12-16 09:56:12 +11:00
committed by GitHub
parent aea2adc44a
commit 1d74d9c5ae
5 changed files with 80 additions and 29 deletions

View File

@ -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",
)
}