mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 01:01:54 +02:00
Make into bits
produce bitstring stream (#13310)
# Description Fix `into bits` to have consistent behavior when passed a byte stream. # User-Facing Changes Previously, it was returning a binary on stream, even though its input/output types don't describe this possibility. We don't need this since we have `into binary` anyway. # Tests + Formatting Tests added
This commit is contained in:
13
crates/nu-cmd-extra/tests/commands/bits/into.rs
Normal file
13
crates/nu-cmd-extra/tests/commands/bits/into.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use nu_test_support::nu;
|
||||
|
||||
#[test]
|
||||
fn byte_stream_into_bits() {
|
||||
let result = nu!("[0x[01] 0x[02 03]] | bytes collect | into bits");
|
||||
assert_eq!("00000001 00000010 00000011", result.out);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn byte_stream_into_bits_is_stream() {
|
||||
let result = nu!("[0x[01] 0x[02 03]] | bytes collect | into bits | describe");
|
||||
assert_eq!("string (stream)", result.out);
|
||||
}
|
1
crates/nu-cmd-extra/tests/commands/bits/mod.rs
Normal file
1
crates/nu-cmd-extra/tests/commands/bits/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
mod into;
|
Reference in New Issue
Block a user