aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 15:46:14 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:00 +0200
commit8102a3ef09cf1cc174ce232690e1d7ba500c2bf0 (patch)
tree913bf07a23e14cf223f237858bb8ea3aa3b1900c /tests/test_core.py
parentdff0b829dd8e624942eef87385ddbe72b3695e8e (diff)
Use do_run_from_file() for test_sscanf_5
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py22
1 files changed, 3 insertions, 19 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 2b9a1f42..07979758 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3733,26 +3733,10 @@ Pass: 0.000012 0.000012''')
self.do_run_from_file(src, output)
def test_sscanf_5(self):
- src = r'''
- #include "stdio.h"
-
- static const char *colors[] = {
- " c black",
- ". c #001100",
- "X c #111100"
- };
+ test_path = path_from_root('tests', 'core', 'test_sscanf_5')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main(){
- unsigned char code;
- char color[32];
- int rcode;
- for(int i = 0; i < 3; i++) {
- rcode = sscanf(colors[i], "%c c %s", &code, color);
- printf("%i, %c, %s\n", rcode, code, color);
- }
- }
- '''
- self.do_run(src, '2, , black\n2, ., #001100\n2, X, #111100');
+ self.do_run_from_file(src, output)
def test_sscanf_6(self):
src = r'''