aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index f3289e46..deeb5689 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4318,6 +4318,19 @@ at function.:blag
'''
self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected))
+ def test_snprintf0(self):
+ src = r'''
+ #include <stdio.h>
+ int main() {
+ int size = snprintf(NULL, 0, "%s %d %.2f\n", "me and myself", 25, 1.345);
+ char buf[size];
+ snprintf(buf, size, "%s %d %.2f\n", "me and myself", 25, 1.345);
+ printf("%d : %s\n", size, buf);
+ return 0;
+ }
+ '''
+ self.do_run(src, '22 : me and myself 25 1.34\n')
+
def test_atoX(self):
if self.emcc_args is None: return self.skip('requires ta2')