mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 10:23:52 +01:00
27 lines
556 B
Rust
27 lines
556 B
Rust
|
use nu_test_support::nu;
|
||
|
|
||
|
#[test]
|
||
|
fn generates_a_float() {
|
||
|
let actual = nu!("random float 42..43");
|
||
|
|
||
|
// Attention: this relies on the string output
|
||
|
assert!(actual.out.starts_with("42") || actual.out.starts_with("43"));
|
||
|
let actual = nu!("random float 42..43 | describe");
|
||
|
|
||
|
assert_eq!(actual.out, "float")
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn generates_55() {
|
||
|
let actual = nu!("random float 55..55");
|
||
|
|
||
|
assert!(actual.out.contains("55"));
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn generates_0() {
|
||
|
let actual = nu!("random float ..<1");
|
||
|
|
||
|
assert!(actual.out.contains('0'));
|
||
|
}
|