Force floats to output a decimal in nuon (#5768)

* Force floats to output a decimal in nuon

* Add test
This commit is contained in:
JT
2022-06-14 05:45:07 +12:00
committed by GitHub
parent 9dbf7556b8
commit 7ae7394c85
2 changed files with 19 additions and 1 deletions

View File

@ -190,3 +190,15 @@ fn read_bool() {
assert_eq!(actual.out, "true")
}
#[test]
fn float_doesnt_become_int() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
1.0 | to nuon
"#
));
assert_eq!(actual.out, "1.0")
}