diff options
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index b766ac74..189da2bc 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -7285,6 +7285,18 @@ date: 18.07.2013w; day 18, month 7, year 2013, extra: 201, 3 ''' self.do_run(src, '4779 4779') + def test_sscanf_float(self): + src = r''' + #include "stdio.h" + + int main(){ + float f1, f2, f3, f4, f5, f6, f7, f8, f9; + sscanf("0.512 0.250x5.129_-9.98 1.12*+54.32E3 +54.32E3^87.5E-3 87.5E-3$", "%f %fx%f_%f %f*%f %f^%f %f$", &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9); + printf("\n%f, %f, %f, %f, %f, %f, %f, %f, %f\n", f1, f2, f3, f4, f5, f6, f7, f8, f9); + } + ''' + self.do_run(src, '\n0.512000, 0.250000, 5.129000, -9.980000, 1.120000, 54320.000000, 54320.000000, 0.087500, 0.087500\n') + 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() |