diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-29 18:17:40 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-29 18:17:40 -0700 |
commit | 77c4a7eb74cc51419331009ca83671395f263c6c (patch) | |
tree | 3afe00e915fb253e975cc359365d8340f0d350f8 /tests/test_other.py | |
parent | 8f998042dc594b59129a77556d1c98160220b585 (diff) | |
parent | 0d23384af497877ad156af27e6f4aa731acea461 (diff) |
Merge pull request #1555 from inolen/tty_fixes
added stubs for tcgetattr and tcsetattr, minor node tty fixes
Diffstat (limited to 'tests/test_other.py')
-rw-r--r-- | tests/test_other.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index a6813b07..eaa5b0d8 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -929,20 +929,11 @@ f.close() self.assertContained('libf1\nlibf2\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) def test_stdin(self): - open('main.cpp', 'w').write(r''' -#include <stdio.h> -int main(int argc, char const *argv[]) -{ - char str[10] = {0}; - scanf("%10s", str); - printf("%s\n", str); - return 0; -} -''') - Building.emcc('main.cpp', output_filename='a.out.js') - open('in.txt', 'w').write('abc') - # node's stdin support is broken - self.assertContained('abc', Popen(listify(SPIDERMONKEY_ENGINE) + ['a.out.js'], stdin=open('in.txt'), stdout=PIPE, stderr=PIPE).communicate()[0]) + Building.emcc(path_from_root('tests', 'module', 'test_stdin.c'), output_filename='a.out.js') + open('in.txt', 'w').write('abcdef\nghijkl') + + for engine in JS_ENGINES: + self.assertContained('abcdef\nghijkl\neof', run_js(os.path.join(self.get_dir(), 'a.out.js'), engine=engine, stdin=open('in.txt'))) def test_ungetc_fscanf(self): open('main.cpp', 'w').write(r''' |