mirror of
https://github.com/nushell/nushell
synced 2024-12-29 06:23:11 +00:00
d83781ddec
Closes #13920 # User-Facing Changes `random binary` and `random chars` now support filesize arguments: ```nushell random binary 1kb random chars --length 1kb ```
21 lines
448 B
Rust
21 lines
448 B
Rust
use nu_test_support::nu;
|
|
|
|
#[test]
|
|
fn generates_chars_of_specified_length() {
|
|
let actual = nu!(r#"
|
|
random chars --length 15 | str stats | get chars
|
|
"#);
|
|
|
|
let result = actual.out;
|
|
assert_eq!(result, "15");
|
|
}
|
|
|
|
#[test]
|
|
fn generates_chars_of_specified_filesize() {
|
|
let actual = nu!(r#"
|
|
random chars --length 1kb | str stats | get bytes
|
|
"#);
|
|
|
|
let result = actual.out;
|
|
assert_eq!(result, "1000");
|
|
}
|