mirror of
https://github.com/nushell/nushell.git
synced 2024-12-04 22:33:50 +01:00
25a8caa9b0
* WIP: experiment with simpler expressions * fix simple invoke * update tests * fix a few tests * Make paren parsing more robust * fix external args * Remove old invocation * Update tests * Update tests
37 lines
685 B
Rust
37 lines
685 B
Rust
use nu_test_support::nu;
|
|
|
|
#[test]
|
|
fn test_parse_invocation_with_range() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
r#"
|
|
let foo = 3
|
|
echo (echo 1..$foo | each { $it }) | to json
|
|
"#
|
|
);
|
|
assert_eq!(actual.out, "[1,2,3]")
|
|
}
|
|
|
|
#[test]
|
|
fn create_nothing_in_table() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
r#"
|
|
echo [[column]; [$nothing]] | to json
|
|
"#
|
|
);
|
|
assert_eq!(actual.out, "{\"column\":null}");
|
|
}
|
|
|
|
#[test]
|
|
fn compare_to_nothing() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
r#"
|
|
let f = $nothing
|
|
if $f == $nothing {echo $true} {echo $false}
|
|
"#
|
|
);
|
|
assert_eq!(actual.out, "true");
|
|
}
|