Initial support for parse-time constants (#7436)

This commit is contained in:
Jakub Žádník
2022-12-22 00:21:03 +02:00
committed by GitHub
parent fa8629300f
commit 3a2c7900d6
18 changed files with 788 additions and 242 deletions

View File

@ -11,6 +11,17 @@ fn source_file_relative_to_file() {
assert_eq!(actual.out, "5");
}
#[test]
fn source_const_file() {
let actual = nu!(cwd: "tests/parsing/samples",
r#"
const file = 'single_line.nu'
source $file
"#);
assert_eq!(actual.out, "5");
}
#[test]
fn run_nu_script_single_line() {
let actual = nu!(cwd: "tests/parsing/samples", r#"