mirror of
https://github.com/nushell/nushell
synced 2024-11-16 17:57:57 +00:00
35 lines
770 B
Rust
35 lines
770 B
Rust
use nu_test_support::nu;
|
|
|
|
// FIXME: jt: needs more work
|
|
#[ignore]
|
|
#[test]
|
|
fn can_sqrt_numbers() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
"echo [0.25 2 4] | math sqrt | math sum"
|
|
);
|
|
|
|
assert_eq!(actual.out, "3.914213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573");
|
|
}
|
|
|
|
// FIXME: jt: needs more work
|
|
#[ignore]
|
|
#[test]
|
|
fn can_sqrt_irrational() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
"echo 2 | math sqrt"
|
|
);
|
|
|
|
assert_eq!(actual.out, "1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573");
|
|
}
|
|
|
|
#[test]
|
|
fn can_sqrt_perfect_square() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
"echo 4 | math sqrt"
|
|
);
|
|
|
|
assert_eq!(actual.out, "2");
|
|
}
|