summaryrefslogtreecommitdiff
path: root/userland/test/test.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-01 19:34:42 +0100
committerAnton Kling <anton@kling.gg>2023-11-13 14:55:09 +0100
commit249d7f4ab0bff181534b0d17f3387f59b7c5feba (patch)
treebbd2aebe704041a086fc2104ae7a092a592b530e /userland/test/test.c
parentec2ca84628a253eda95ccb097a2e269dc1dc47b8 (diff)
LibC: Support negative values in printf for %d
Diffstat (limited to 'userland/test/test.c')
-rw-r--r--userland/test/test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/userland/test/test.c b/userland/test/test.c
index 041b08a..ca8c142 100644
--- a/userland/test/test.c
+++ b/userland/test/test.c
@@ -545,6 +545,12 @@ void printf_test(void) {
buf_n = sprintf(buf, "int: %00d", 1);
EXP("int: 1");
+ buf_n = sprintf(buf, "int: %d", -1337);
+ EXP("int: -1337");
+
+ buf_n = sprintf(buf, "int: %u", 1337);
+ EXP("int: 1337");
+
buf_n = sprintf(buf, "hex: %02x", 1);
EXP("hex: 01");
buf_n = sprintf(buf, "hex: %2x", 1);