mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
fixes to nuon
for inf, -inf, and NaN (#5818)
This commit is contained in:
@ -202,3 +202,39 @@ fn float_doesnt_become_int() {
|
||||
|
||||
assert_eq!(actual.out, "1.0")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn float_inf_parsed_properly() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
inf | to nuon
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "inf")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn float_neg_inf_parsed_properly() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
-inf | to nuon
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "-inf")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn float_nan_parsed_properly() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
NaN | to nuon
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "NaN")
|
||||
}
|
||||
|
Reference in New Issue
Block a user