diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-20 12:03:41 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-20 12:03:41 +0100 |
commit | 55f68854352ca06b7f6415b9fb350c92c30ec9d4 (patch) | |
tree | ba59f87c7aec20f7433b8cfbed8ae32f61babc70 /tests | |
parent | 8bba2b426d62080aa5a6191c48719dd142bebc12 (diff) |
fix sscanf bug and clean up code; fixes #723
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 5896f481..bea617d6 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -4542,7 +4542,22 @@ Pass: 0.000012 0.000012''') self.do_run(src, '3\n123,1073741823,1125899906842620\n' + '3\n-123,-1073741823,-1125899906842620\n') - + + def test_sscanf_4(self): + src = r''' + #include <stdio.h> + + int main() + { + char pYear[16], pMonth[16], pDay[16], pDate[64]; + printf("%d\n", sscanf("Nov 19 2012", "%s%s%s", pMonth, pDay, pYear)); + printf("day %s, month %s, year %s \n", pDay, pMonth, pYear); + return(0); + } + ''' + + self.do_run(src, '3\nday 19, month Nov, year 2012'); + 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() |