diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-05 21:48:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-05 21:48:26 -0800 |
commit | 2dfe0ad02c8d84d5d0c22515422d422e8ca7a347 (patch) | |
tree | 1ec8880d2048b803bce23c2c80cc80f79878b6f9 /tests/runner.py | |
parent | 78a230ab665daad0fe11d40bdaca1c995fbe9add (diff) |
fix bug with sscanf on negative floats
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index a1fa8690..044e5cf2 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -3289,13 +3289,16 @@ at function.:blag printf("%f, %f\n", atof("1.234567"), atof("cheez")); + float a = -1; + sscanf("-3.03", "%f", &a); + printf("%.4f\n", a); + return 0; } ''' - self.do_run(src, 'en-us : 2*en-r : 99*en : 3*1.234567, 0.000000', - output_nicerizer = lambda x: x.replace('\n', '*')) + self.do_run(src, 'en-us : 2\nen-r : 99\nen : 3\n1.234567, 0.000000\n-3.0300') - # Part 2: doubles (issue 148) + # Part 2: doubles if Settings.USE_TYPED_ARRAYS == 2: for ftype in ['float', 'double']: src = r''' |