summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_array2b.in16
-rw-r--r--tests/core/test_array2b.out2
-rw-r--r--tests/test_core.py20
3 files changed, 21 insertions, 17 deletions
diff --git a/tests/core/test_array2b.in b/tests/core/test_array2b.in
new file mode 100644
index 00000000..b94821d8
--- /dev/null
+++ b/tests/core/test_array2b.in
@@ -0,0 +1,16 @@
+
+ #include <stdio.h>
+
+ static const struct {
+ unsigned char left;
+ unsigned char right;
+ } prioritah[] = {
+ {6, 6}, {6, 6}, {7, 95}, {7, 7}
+ };
+
+ int main() {
+ printf("*%d,%d\n", prioritah[1].left, prioritah[1].right);
+ printf("%d,%d*\n", prioritah[2].left, prioritah[2].right);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_array2b.out b/tests/core/test_array2b.out
new file mode 100644
index 00000000..422896dc
--- /dev/null
+++ b/tests/core/test_array2b.out
@@ -0,0 +1,2 @@
+*6,6
+7,95* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index d9967858..d3afa540 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1719,24 +1719,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_array2b(self):
- src = '''
- #include <stdio.h>
-
- static const struct {
- unsigned char left;
- unsigned char right;
- } prioritah[] = {
- {6, 6}, {6, 6}, {7, 95}, {7, 7}
- };
-
- int main() {
- printf("*%d,%d\\n", prioritah[1].left, prioritah[1].right);
- printf("%d,%d*\\n", prioritah[2].left, prioritah[2].right);
- return 0;
- }
- '''
- self.do_run(src, '*6,6\n7,95*')
+ test_path = path_from_root('tests', 'core', 'test_array2b')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
def test_constglobalstructs(self):
src = '''