summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_if_else.in13
-rw-r--r--tests/core/test_if_else.out1
-rw-r--r--tests/test_core.py18
3 files changed, 18 insertions, 14 deletions
diff --git a/tests/core/test_if_else.in b/tests/core/test_if_else.in
new file mode 100644
index 00000000..03b2bfa6
--- /dev/null
+++ b/tests/core/test_if_else.in
@@ -0,0 +1,13 @@
+
+ #include <stdio.h>
+ int main()
+ {
+ int x = 5;
+ if (x > 10) {
+ printf("*yes*\n");
+ } else {
+ printf("*no*\n");
+ }
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_if_else.out b/tests/core/test_if_else.out
new file mode 100644
index 00000000..208ac5ec
--- /dev/null
+++ b/tests/core/test_if_else.out
@@ -0,0 +1 @@
+*no* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 7c69321e..6c17c5e0 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -900,20 +900,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_if_else(self):
- src = '''
- #include <stdio.h>
- int main()
- {
- int x = 5;
- if (x > 10) {
- printf("*yes*\\n");
- } else {
- printf("*no*\\n");
- }
- return 0;
- }
- '''
- self.do_run(src, '*no*')
+ test_path = path_from_root('tests', 'core', 'test_if_else')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_loop(self):
src = '''