aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py32
1 files changed, 3 insertions, 29 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index ae891355..c2faf81d 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3712,36 +3712,10 @@ Pass: 0.000012 0.000012''')
def test_sscanf_other_whitespace(self):
Settings.SAFE_HEAP = 0 # use i16s in printf
- src = r'''
- #include<stdio.h>
-
- int main() {
- short int x;
- short int y;
-
- const char* buffer[] = {
- "\t2\t3\t", /* TAB - horizontal tab */
- "\t\t5\t\t7\t\t",
- "\n11\n13\n", /* LF - line feed */
- "\n\n17\n\n19\n\n",
- "\v23\v29\v", /* VT - vertical tab */
- "\v\v31\v\v37\v\v",
- "\f41\f43\f", /* FF - form feed */
- "\f\f47\f\f53\f\f",
- "\r59\r61\r", /* CR - carrage return */
- "\r\r67\r\r71\r\r"
- };
-
- for (int i=0; i<10; ++i) {
- x = 0; y = 0;
- sscanf(buffer[i], " %d %d ", &x, &y);
- printf("%d, %d, ", x, y);
- }
+ test_path = path_from_root('tests', 'core', 'test_sscanf_other_whitespace')
+ src, output = (test_path + s for s in ('.in', '.out'))
- return 0;
- }
- '''
- self.do_run(src, '''2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, ''')
+ self.do_run_from_file(src, output)
def test_sscanf_3(self):
# i64