Skip to content

Commit

Permalink
Added an integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt authored and theduke committed Jun 8, 2023
1 parent 5ce83f5 commit 07fc1ed
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wasix/src/syscalls/wasix/sock_accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ pub fn sock_accept<M: MemorySize>(
Ok(Errno::Success)
}

/// ### `sock_accept()`
/// ### `sock_accept_v2()`
/// Accept a new incoming connection.
/// Note: This is similar to `accept` in POSIX.
///
/// ## Parameters
///
/// * `fd` - The listening socket.
/// * `flags` - The desired values of the file descriptor flags.
/// * `ro_addr` - Returns the address and port of the client
///
/// ## Return
///
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/cli/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,17 @@ fn test_snapshot_dash_python() {
assert_json_snapshot!(snapshot);
}

#[cfg_attr(any(target_env = "musl", target_os = "windows"), ignore)]
#[test]
fn test_snapshot_python_3_11_3() {
let snapshot = TestBuilder::new()
.with_name(function!())
.arg("-c")
.arg("print(10)")
.run_wasm(include_bytes!("./wasm/python-3.11.3.wasm"));
assert_json_snapshot!(snapshot);
}

#[cfg_attr(any(target_env = "musl", target_os = "windows"), ignore)]
#[test]
fn test_snapshot_dash_dev_zero() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
source: tests/integration/cli/tests/snapshot.rs
assertion_line: 1093
expression: snapshot
---
{
"spec": {
"name": "snapshot::test_snapshot_python_3_11_3",
"use_packages": [],
"include_webcs": [],
"cli_args": [
"-c",
"print(10)"
],
"enable_threads": true,
"enable_network": false
},
"result": {
"Success": {
"stdout": "10\n",
"stderr": "",
"exit_code": 0
}
}
}
Binary file not shown.

0 comments on commit 07fc1ed

Please sign in to comment.