diff options
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index c33f7565..517f2bcf 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -236,7 +236,7 @@ if 'benchmark' not in str(sys.argv): # If not provided with expected output, then generate it right now, using lli if expected_output is None: expected_output = self.run_llvm_interpreter([filename + '.o']) - print '[autogenerated expected output: %20s]' % (expected_output[0:17].replace('\n', '')+'...') + print '[autogenerated expected output: %20s]' % (expected_output[0:30].replace('\n', '|')+'...') # Run in both JavaScript engines, if optimizing - significant differences there (typed arrays) if js_engines is None: @@ -2349,6 +2349,29 @@ if 'benchmark' not in str(sys.argv): ''' self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected)) + def test_sscanf(self): + src = r''' + #include <stdio.h> + #include <string.h> + + int main () { + #define CHECK(str) \ + { \ + char name[1000]; \ + memset(name, 0, 1000); \ + int prio = 99; \ + sscanf(str, "%s %d", name, &prio); \ + printf("%s : %d\n", name, prio); \ + } + CHECK("en-us 2"); + CHECK("en-r"); + CHECK("en 3"); + + return 0; + } + ''' + self.do_run(src) + def test_langinfo(self): src = open(path_from_root('tests', 'langinfo', 'test.c'), 'r').read() expected = open(path_from_root('tests', 'langinfo', 'output.txt'), 'r').read() |