aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-11 11:33:45 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-10-11 11:33:59 -0400
commit2cc20b41629bc533902ab25771388665c9276e58 (patch)
treecbdf3a6738e32fad1867540ed75ca8c8811c0b53 /tests
parent7c817f1d409f072d09caf39e7aa80290ce006d16 (diff)
C++ demangle helper
Diffstat (limited to 'tests')
-rw-r--r--tests/test_other.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_other.py b/tests/test_other.py
index 264e75e1..2f31aae0 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -1906,3 +1906,19 @@ done.
assert '''tests/hello_world.c"''' in out
assert '''printf("hello, world!''' in out
+ def test_demangle(self):
+ open('src.cpp', 'w').write('''
+ #include <stdio.h>
+ #include <emscripten.h>
+ int main() {
+ EM_ASM(Module.print(demangle('_main')));
+ EM_ASM(Module.print(demangle('__Z2f2v')));
+ EM_ASM(Module.print(demangle('__Z12abcdabcdabcdi')));
+ EM_ASM(Module.print(demangle('__ZN4Waka1f12a234123412345pointEv')));
+ return 0;
+ }
+ ''')
+
+ Popen([PYTHON, EMCC, 'src.cpp']).communicate()
+ self.assertContained('main\nf2\nabcdabcdabcd\nWaka::f::a23412341234::point\n', run_js('a.out.js'))
+