diff options
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index e8cfba42..e51f8e86 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2245,6 +2245,25 @@ if 'benchmark' not in sys.argv: expected = open(path_from_root('tests', 'printf', 'output.txt'), 'r').read() self.do_test(src, expected) + def test_printf_types(self): + src = r''' + #include <stdio.h> + + int main() { + char c = '1'; + short s = 2; + int i = 3; + long long l = 4; + float f = 5.5; + double d = 6.6; + + printf("%c,%hd,%d,%lld,%.1f,%.1llf\n", c, s, i, l, f, d); + + return 0; + } + ''' + self.do_test(src, '1,2,3,4,5.5,6.6\n') + def test_vprintf(self): src = r''' #include <stdio.h> |