nushell/crates/nu-cli/tests/commands/random/decimal.rs
smaydew 5fb3df4054
Initial implementation of the random decimal subcommand. (#2762)
Co-authored-by: Stacy Maydew <stacy.maydew@starlab.io>
2020-11-24 22:19:48 +13:00

38 lines
619 B
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn generates_an_decimal() {
let actual = nu!(
cwd: ".", pipeline(
r#"
random decimal 42..43
"#
));
assert!(actual.out.contains("42") || actual.out.contains("43"));
}
#[test]
fn generates_55() {
let actual = nu!(
cwd: ".", pipeline(
r#"
random decimal 55..55
"#
));
assert!(actual.out.contains("55"));
}
#[test]
fn generates_0() {
let actual = nu!(
cwd: ".", pipeline(
r#"
random decimal ..<1
"#
));
assert!(actual.out.contains('0'));
}