mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
support binary input in length
(#14224)
Closes #13874 # User-Facing Changes `length` now supports binary input: ```nushell > random binary 1kb | length 1000 ```
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
use nu_test_support::fs::Stub::FileWithContent;
|
||||
use nu_test_support::nu;
|
||||
use nu_test_support::playground::Playground;
|
||||
|
||||
#[test]
|
||||
fn length_columns_in_cal_table() {
|
||||
@ -20,3 +22,14 @@ fn length_fails_on_echo_record() {
|
||||
|
||||
assert!(actual.err.contains("only_supports_this_input_type"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn length_byte_stream() {
|
||||
Playground::setup("length_bytes", |dirs, sandbox| {
|
||||
sandbox.mkdir("length_bytes");
|
||||
sandbox.with_files(&[FileWithContent("data.txt", "😀")]);
|
||||
|
||||
let actual = nu!(cwd: dirs.test(), "open data.txt | length");
|
||||
assert_eq!(actual.out, "4");
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user