Update wasm tests to just check the text of stdout

This commit is contained in:
Noah committed 2020-05-06 22:45:44 -05:00
1 parent 34ceee9de1
commit b6f4c68431
3 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -41,4 +41,4 @@ features = [
]
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O1"]
wasm-opt = false#["-O1"]
+7 -4
View File
@@ -1,18 +1,21 @@
def test_eval_mode(wdriver):
assert wdriver.execute_script("return window.rp.pyEval('1+1')") == 2
def test_exec_mode(wdriver):
assert wdriver.execute_script("return window.rp.pyExec('1+1')") is None
def test_exec_single_mode(wdriver):
assert wdriver.execute_script("return window.rp.pyExecSingle('1+1')") == 2
assert wdriver.execute_script(
stdout = wdriver.execute_script(
"""
var output = [];
let output = "";
save_output = function(text) {{
output.push(text)
output += text
}};
window.rp.pyExecSingle('1+1\\n2+2',{stdout: save_output});
return output;
"""
) == ["2\n", "4\n"]
)
assert stdout == "2\n4\n"
-1
View File
@@ -19,4 +19,3 @@ assert mod.get_thing() == 1
);
"""
)