2023-07-17 16:43:51 +00:00
|
|
|
use nu_test_support::nu;
|
2020-09-03 19:23:02 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn generates_an_integer() {
|
2023-10-03 16:24:32 +00:00
|
|
|
let actual = nu!("random int 42..43");
|
2020-09-03 19:23:02 +00:00
|
|
|
|
|
|
|
assert!(actual.out.contains("42") || actual.out.contains("43"));
|
|
|
|
}
|
2020-09-19 20:41:49 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn generates_55() {
|
2023-10-03 16:24:32 +00:00
|
|
|
let actual = nu!("random int 55..55");
|
2020-09-19 20:41:49 +00:00
|
|
|
|
|
|
|
assert!(actual.out.contains("55"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn generates_0() {
|
2023-10-03 16:24:32 +00:00
|
|
|
let actual = nu!("random int ..<1");
|
2020-09-19 20:41:49 +00:00
|
|
|
|
2020-10-08 21:47:51 +00:00
|
|
|
assert!(actual.out.contains('0'));
|
2020-09-19 20:41:49 +00:00
|
|
|
}
|