Skip to content

Commit

Permalink
Fixed up more of the snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt committed Mar 16, 2023
1 parent a2cb391 commit 5a54a0b
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wasi/tests/runners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod wasi {
WasiError::Exit(code) => *code,
other => unreachable!("Something else went wrong: {:?}", other),
};
assert_eq!(exit_code, 1);
assert_eq!(exit_code.is_success(), true);
}

#[tokio::test]
Expand All @@ -77,7 +77,7 @@ mod wasi {
WasiError::Exit(code) => *code,
other => unreachable!("Something else went wrong: {:?}", other),
};
assert_eq!(exit_code, 42);
assert_eq!(exit_code.raw(), 42);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
source: tests/integration/cli/tests/snapshot.rs
assertion_line: 594
expression: snapshot
---
{
"spec": {
"name": "snapshot::test_snapshot_bash_bash",
"use_packages": [
"sharrattj/bash"
],
"cli_args": [],
"stdin": [
47,
98,
105,
110,
47,
98,
97,
115,
104,
10,
101,
99,
104,
111,
32,
104,
105,
10,
101,
120,
105,
116,
10,
101,
99,
104,
111,
32,
104,
105,
50,
10
],
"debug_output": false,
"enable_threads": true
},
"result": {
"Success": {
"stdout": "hi\nhi2\n",
"stderr": "test.wasm-5.1# bash-5.1# bash-5.1# exit\ntest.wasm-5.1# test.wasm-5.1# exit\n",
"exit_code": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
source: tests/integration/cli/tests/snapshot.rs
assertion_line: 622
expression: snapshot
---
{
"spec": {
"name": "snapshot::test_snapshot_bash_dash",
"use_packages": [
"sharrattj/dash"
],
"cli_args": [],
"stdin": [
47,
98,
105,
110,
47,
100,
97,
115,
104,
10,
101,
99,
104,
111,
32,
104,
105,
10,
101,
120,
105,
116,
10,
101,
120,
105,
116,
10
],
"debug_output": false,
"enable_threads": true
},
"result": {
"Success": {
"stdout": "hi\n",
"stderr": "test.wasm-5.1# # # test.wasm-5.1# exit\n",
"exit_code": 78
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
source: tests/integration/cli/tests/snapshot.rs
assertion_line: 561
expression: snapshot
---
{
"spec": {
"name": "snapshot::test_snapshot_dash_bash",
"use_packages": [
"sharrattj/bash"
],
"cli_args": [],
"stdin": [
47,
98,
105,
110,
47,
98,
97,
115,
104,
10,
101,
99,
104,
111,
32,
104,
105,
10,
101,
120,
105,
116,
10,
101,
120,
105,
116,
10
],
"debug_output": false,
"enable_threads": true
},
"result": {
"Success": {
"stdout": "hi\n",
"stderr": "# bash-5.1# exit\n# # ",
"exit_code": 78
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
source: tests/integration/cli/tests/snapshot.rs
assertion_line: 551
expression: snapshot
---
{
"spec": {
"name": "snapshot::test_snapshot_dash_dash",
"use_packages": [
"sharrattj/dash"
],
"cli_args": [],
"stdin": [
47,
98,
105,
110,
47,
100,
97,
115,
104,
10,
101,
99,
104,
111,
32,
104,
105,
10,
101,
120,
105,
116,
10,
101,
120,
105,
116,
10
],
"debug_output": false,
"enable_threads": true
},
"result": {
"Success": {
"stdout": "hi\n",
"stderr": "# # \n# # ",
"exit_code": 78
}
}
}
Binary file modified tests/integration/cli/tests/wasm/web-server.wasm
Binary file not shown.

0 comments on commit 5a54a0b

Please sign in to comment.