diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_sscanf_6.in | 14 | ||||
-rw-r--r-- | tests/core/test_sscanf_6.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/tests/core/test_sscanf_6.in b/tests/core/test_sscanf_6.in index 63ede53f..e0541670 100644 --- a/tests/core/test_sscanf_6.in +++ b/tests/core/test_sscanf_6.in @@ -11,4 +11,18 @@ int main() { i = sscanf(date, "%d.%d.%3c", &d, &m, c); printf("date: %s; day %2d, month %2d, year %4d, extra: %s, %d\n", date, d, m, y, c, i); + + { + char *date = "18.07.2013", c; + int y, m, d, i; + if ((i = sscanf(date, "%d.%d.%4d%c", &d, &m, &y, &c)) == 3) + { + printf("date: %s; day %2d, month %2d, year %4d \n", date, d, m, y); + } + else + { + printf("Error in sscanf: actually parsed %d", i); + } + } } + diff --git a/tests/core/test_sscanf_6.out b/tests/core/test_sscanf_6.out index 4aee073e..7256b03b 100644 --- a/tests/core/test_sscanf_6.out +++ b/tests/core/test_sscanf_6.out @@ -1,2 +1,3 @@ date: 18.07.2013w; day 18, month 7, year 2013, extra: w, 4 date: 18.07.2013w; day 18, month 7, year 2013, extra: 201, 3 +date: 18.07.2013; day 18, month 7, year 2013 diff --git a/tests/test_core.py b/tests/test_core.py index 594350fb..90453ae2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3853,7 +3853,6 @@ Pass: 0.000012 0.000012''') def test_sscanf_6(self): test_path = path_from_root('tests', 'core', 'test_sscanf_6') src, output = (test_path + s for s in ('.in', '.out')) - self.do_run_from_file(src, output) def test_sscanf_skip(self): |