diff options
-rw-r--r-- | tests/core/test_tinyfuncstr.in | 13 | ||||
-rw-r--r-- | tests/core/test_tinyfuncstr.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 15 |
3 files changed, 17 insertions, 12 deletions
diff --git a/tests/core/test_tinyfuncstr.in b/tests/core/test_tinyfuncstr.in new file mode 100644 index 00000000..ea07ff33 --- /dev/null +++ b/tests/core/test_tinyfuncstr.in @@ -0,0 +1,13 @@ + + #include <stdio.h> + + struct Class { + static char *name1() { return "nameA"; } + char *name2() { return "nameB"; } + }; + + int main() { + printf("*%s,%s*\n", Class::name1(), (new Class())->name2()); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_tinyfuncstr.out b/tests/core/test_tinyfuncstr.out new file mode 100644 index 00000000..ed0d2567 --- /dev/null +++ b/tests/core/test_tinyfuncstr.out @@ -0,0 +1 @@ +*nameA,nameB*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index adbe1826..25daae15 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1999,20 +1999,11 @@ def process(filename): def test_tinyfuncstr(self): if self.emcc_args is None: return self.skip('requires emcc') - src = ''' - #include <stdio.h> - struct Class { - static char *name1() { return "nameA"; } - char *name2() { return "nameB"; } - }; + test_path = path_from_root('tests', 'core', 'test_tinyfuncstr') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - printf("*%s,%s*\\n", Class::name1(), (new Class())->name2()); - return 0; - } - ''' - self.do_run(src, '*nameA,nameB*') + self.do_run_from_file(src, output) def test_llvmswitch(self): Settings.CORRECT_SIGNS = 1 |