Browse Source

Add test for negative pad stupport in printf

oddcoder 4 năm trước cách đây
mục cha
commit
7eba6d88df

+ 1 - 0
tests/Makefile

@@ -45,6 +45,7 @@ EXPECT_NAMES=\
 	stdio/ungetc_multiple \
 	stdio/ungetc_ftell \
 	stdio/fscanf_offby1 \
+	stdio/printf_neg_pad \
 	stdlib/a64l \
 	stdlib/alloc \
 	stdlib/atof \

+ 0 - 0
tests/expected/stdio/printf_neg_pad.stderr


+ 2 - 0
tests/expected/stdio/printf_neg_pad.stdout

@@ -0,0 +1,2 @@
+A    BCC/
+AB    CC/

+ 5 - 0
tests/stdio/printf_neg_pad.c

@@ -0,0 +1,5 @@
+#include <stdio.h>
+int main() {
+        printf ("A%*s%s/\n", 5, "B", "CC");
+        printf ("A%*s%s/\n", -5, "B", "CC");
+}