We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f86f46f commit c533d94Copy full SHA for c533d94
tests/by-util/test_printf.rs
@@ -878,6 +878,30 @@ fn float_with_zero_precision_should_pad() {
878
.stdout_only("-01");
879
}
880
881
+#[test]
882
+fn float_non_finite() {
883
+ new_ucmd!()
884
+ .args(&[
885
+ "%f %f %F %f %f %F",
886
+ "nan",
887
+ "-nan",
888
889
+ "inf",
890
+ "-inf",
891
892
+ ])
893
+ .succeeds()
894
+ .stdout_only("nan -nan NAN inf -inf INF");
895
+}
896
+
897
898
+fn float_zero_neg_zero() {
899
900
+ .args(&["%f %f", "0.0", "-0.0"])
901
902
+ .stdout_only("0.000000 -0.000000");
903
904
905
#[test]
906
fn precision_check() {
907
new_ucmd!()
0 commit comments