2022-07-04 07:53:54 +00:00
|
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn binary_skip() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
|
|
r#"
|
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 11:35:12 +00:00
|
|
|
open sample_data.ods --raw |
|
|
|
|
skip 2 |
|
|
|
|
take 2 |
|
2022-07-04 07:53:54 +00:00
|
|
|
into int
|
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "772");
|
|
|
|
}
|
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 11:35:12 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fail_on_non_iterator() {
|
2023-07-17 16:43:51 +00:00
|
|
|
let actual = nu!("1 | skip 2");
|
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 11:35:12 +00:00
|
|
|
|
2023-07-14 03:20:35 +00:00
|
|
|
assert!(actual.err.contains("command doesn't support"));
|
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 11:35:12 +00:00
|
|
|
}
|