nushell/crates/nu-command/tests/commands/empty.rs

22 lines
462 B
Rust
Raw Normal View History

2020-10-06 12:21:20 +02:00
use nu_test_support::{nu, pipeline};
#[test]
fn reports_emptiness() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo [[are_empty];
[([[check]; [[]] ])]
[([[check]; [""] ])]
[([[check]; [{}] ])]
2020-10-06 12:21:20 +02:00
]
| get are_empty
| all? {
empty? check
}
2020-10-06 12:21:20 +02:00
"#
));
assert_eq!(actual.out, "true");
2020-10-06 12:21:20 +02:00
}