diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 22:59:43 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:51 +0200 |
commit | 1bcfea047f9b3f0c3d5ce821c4ada85a8a46c205 (patch) | |
tree | f19ba1445ad7402d5b157f96eb8dd42bf7aee16c /tests | |
parent | 13ce6a163687659b805c13c0c25caa1ef1ae57f4 (diff) |
Use do_run_from_file() for test_if
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_if.in | 11 | ||||
-rw-r--r-- | tests/core/test_if.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 16 |
3 files changed, 16 insertions, 12 deletions
diff --git a/tests/core/test_if.in b/tests/core/test_if.in new file mode 100644 index 00000000..20ed3a01 --- /dev/null +++ b/tests/core/test_if.in @@ -0,0 +1,11 @@ + + #include <stdio.h> + int main() + { + int x = 5; + if (x > 3) { + printf("*yes*\n"); + } + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_if.out b/tests/core/test_if.out new file mode 100644 index 00000000..f74b0639 --- /dev/null +++ b/tests/core/test_if.out @@ -0,0 +1 @@ +*yes*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 929e724b..7c69321e 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -894,18 +894,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_ll_run(all_name, 'result: 1') def test_if(self): - src = ''' - #include <stdio.h> - int main() - { - int x = 5; - if (x > 3) { - printf("*yes*\\n"); - } - return 0; - } - ''' - self.do_run(src, '*yes*') + test_path = path_from_root('tests', 'core', 'test_if') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) def test_if_else(self): src = ''' |