2023-07-17 16:43:51 +00:00
|
|
|
use nu_test_support::nu;
|
2020-12-08 17:43:46 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn generates_chars_of_specified_length() {
|
2023-07-17 16:43:51 +00:00
|
|
|
let actual = nu!(r#"
|
2023-11-16 22:49:19 +00:00
|
|
|
random chars --length 15 | str stats | get chars
|
2023-07-17 16:43:51 +00:00
|
|
|
"#);
|
2020-12-08 17:43:46 +00:00
|
|
|
|
|
|
|
let result = actual.out;
|
|
|
|
assert_eq!(result, "15");
|
|
|
|
}
|
2024-10-12 06:49:05 +00:00
|
|
|
|
|
|
|
#[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");
|
|
|
|
}
|