2022-02-04 03:01:45 +01:00
|
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn adds_a_row_to_the_end() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
2022-02-21 14:38:15 +01:00
|
|
|
echo [ "Andrés N. Robalino", "Jonathan Turner", "Yehuda Katz" ]
|
2022-02-04 03:01:45 +01:00
|
|
|
| append "pollo loco"
|
2022-02-09 11:58:54 +01:00
|
|
|
| get 3
|
2022-02-04 03:01:45 +01:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "pollo loco");
|
2019-12-15 17:15:06 +01:00
|
|
|
}
|
last, skip, drop, take until, take while, skip until, skip while, where, reverse, shuffle, append, prepend and sort-by raise error when given non-lists (#7623)
Closes https://github.com/nushell/nushell/issues/6941
2022-12-31 12:35:12 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fail_on_non_iterator() {
|
|
|
|
let actual = nu!(cwd: ".", pipeline("1 | append 3"));
|
|
|
|
|
|
|
|
assert!(actual.err.contains("only_supports_this_input_type"));
|
|
|
|
}
|