Skip to content

Commit 0c0d119

Browse files
committed
test: printf: Add a test for scientific printing of negative number
This was broken before the last few commits.
1 parent 92a291b commit 0c0d119

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/by-util/test_printf.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,14 @@ fn sub_num_dec_trunc() {
380380
.stdout_only("pi is ~ 3.14159");
381381
}
382382

383+
#[test]
384+
fn sub_num_sci_negative() {
385+
new_ucmd!()
386+
.args(&["-1234 is %e", "-1234"])
387+
.succeeds()
388+
.stdout_only("-1234 is -1.234000e+03");
389+
}
390+
383391
#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
384392
#[test]
385393
fn sub_num_hex_float_lower() {

0 commit comments

Comments
 (0)