aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_transtrcase.in13
-rw-r--r--tests/core/test_transtrcase.out1
-rw-r--r--tests/test_core.py18
3 files changed, 18 insertions, 14 deletions
diff --git a/tests/core/test_transtrcase.in b/tests/core/test_transtrcase.in
new file mode 100644
index 00000000..0592405e
--- /dev/null
+++ b/tests/core/test_transtrcase.in
@@ -0,0 +1,13 @@
+
+ #include <stdio.h>
+ #include <string.h>
+ int main() {
+ char szToupr[] = "hello, ";
+ char szTolwr[] = "EMSCRIPTEN";
+ strupr(szToupr);
+ strlwr(szTolwr);
+ printf(szToupr);
+ printf(szTolwr);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_transtrcase.out b/tests/core/test_transtrcase.out
new file mode 100644
index 00000000..dbb541e6
--- /dev/null
+++ b/tests/core/test_transtrcase.out
@@ -0,0 +1 @@
+HELLO, emscripten \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 55cf142e..5b3a64dd 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3574,20 +3574,10 @@ ok
self.do_run(src, expected)
def test_transtrcase(self):
- src = '''
- #include <stdio.h>
- #include <string.h>
- int main() {
- char szToupr[] = "hello, ";
- char szTolwr[] = "EMSCRIPTEN";
- strupr(szToupr);
- strlwr(szTolwr);
- printf(szToupr);
- printf(szTolwr);
- return 0;
- }
- '''
- self.do_run(src, 'HELLO, emscripten')
+ test_path = path_from_root('tests', 'core', 'test_transtrcase')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_printf(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('i64 mode 1 requires ta2')