mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update wasm tests to just check the text of stdout
This commit is contained in:
3 files changed
+8
-6
No files matched your search
+1
-1
@@ -41,4 +41,4 @@ features = [
|
||||
]
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = ["-O1"]
|
||||
wasm-opt = false#["-O1"]
|
||||
@@ -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"
|
||||
@@ -19,4 +19,3 @@ assert mod.get_thing() == 1
|
||||
);
|
||||
"""
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user