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