Fix wrong parsing of signatures in predecl scan (#10637)

This commit is contained in:
Jakub Žádník
2023-10-07 16:42:09 +03:00
committed by GitHub
parent eb4fd144eb
commit 67b5e1bde9
2 changed files with 19 additions and 2 deletions

View File

@ -102,6 +102,23 @@ fn parse_file_relative_to_parsed_file_simple() {
})
}
#[test]
fn predecl_signature_parse() {
Playground::setup("predecl_signature_parse", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"spam.nu",
"
def main [] { foo }
def foo []: nothing -> nothing { print 'foo' }
",
)]);
let actual = nu!(cwd: dirs.test(), pipeline("nu spam.nu"));
assert_eq!(actual.out, "foo");
})
}
#[ignore]
#[test]
fn parse_file_relative_to_parsed_file() {