From 7eba6d88dfc7ba2fb26737e2dc3207d79292b849 Mon Sep 17 00:00:00 2001 From: oddcoder Date: Sat, 23 May 2020 15:29:16 +0200 Subject: [PATCH] Add test for negative pad stupport in printf --- tests/Makefile | 1 + tests/expected/stdio/printf_neg_pad.stderr | 0 tests/expected/stdio/printf_neg_pad.stdout | 2 ++ tests/stdio/printf_neg_pad.c | 5 +++++ 4 files changed, 8 insertions(+) create mode 100644 tests/expected/stdio/printf_neg_pad.stderr create mode 100644 tests/expected/stdio/printf_neg_pad.stdout create mode 100644 tests/stdio/printf_neg_pad.c diff --git a/tests/Makefile b/tests/Makefile index c6958733d2..7ff599552b 100644 --- a/tests/Makefile +++ b/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 \ diff --git a/tests/expected/stdio/printf_neg_pad.stderr b/tests/expected/stdio/printf_neg_pad.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/stdio/printf_neg_pad.stdout b/tests/expected/stdio/printf_neg_pad.stdout new file mode 100644 index 0000000000..f573a2b6d2 --- /dev/null +++ b/tests/expected/stdio/printf_neg_pad.stdout @@ -0,0 +1,2 @@ +A BCC/ +AB CC/ diff --git a/tests/stdio/printf_neg_pad.c b/tests/stdio/printf_neg_pad.c new file mode 100644 index 0000000000..7f443034b9 --- /dev/null +++ b/tests/stdio/printf_neg_pad.c @@ -0,0 +1,5 @@ +#include +int main() { + printf ("A%*s%s/\n", 5, "B", "CC"); + printf ("A%*s%s/\n", -5, "B", "CC"); +}