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];
|
2021-05-12 03:01:48 +02:00
|
|
|
[([[check]; [[]] ])]
|
|
|
|
[([[check]; [""] ])]
|
2022-05-01 05:32:30 +02:00
|
|
|
[([[check]; [{}] ])]
|
2020-10-06 12:21:20 +02:00
|
|
|
]
|
|
|
|
| get are_empty
|
2022-09-05 16:41:06 +02:00
|
|
|
| all {
|
|
|
|
is-empty check
|
2022-05-01 05:32:30 +02:00
|
|
|
}
|
2020-10-06 12:21:20 +02:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
2022-05-01 05:32:30 +02:00
|
|
|
assert_eq!(actual.out, "true");
|
2020-10-06 12:21:20 +02:00
|
|
|
}
|