diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-16 21:19:28 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-16 21:19:28 -0700 |
commit | 396cb4f707dfab0a38edc40b430b441da353ffbb (patch) | |
tree | d3318b3da155d2079cb57c1c1e7010e3e9aa146b /tests | |
parent | b7015676a448b95999120d91ceaa2f2d21aeb0eb (diff) |
fix sscanf handling of ends of %s
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index 871230c6..a6e65d20 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -3747,12 +3747,20 @@ at function.:blag sscanf("-3.03", "%f", &a); printf("%.4f\n", a); + char buffy[100]; + sscanf("cheez some thing moar 123\nyet more\n", "cheez %s", buffy); + printf("|%s|\n", buffy); + sscanf("cheez something\nmoar 123\nyet more\n", "cheez %s", buffy); + printf("|%s|\n", buffy); + sscanf("cheez somethingmoar\tyet more\n", "cheez %s", buffy); + printf("|%s|\n", buffy); return 0; } ''' - self.do_run(src, 'en-us : 2\nen-r : 99\nen : 3\n1.234567, 0.000000\n-3.0300') + self.do_run(src, 'en-us : 2\nen-r : 99\nen : 3\n1.234567, 0.000000\n-3.0300\n|some|\n|something|\n|somethingmoar|') - # Part 2: doubles + def test_sscanf_2(self): + # doubles if Settings.USE_TYPED_ARRAYS == 2: for ftype in ['float', 'double']: src = r''' |