diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/ops/net.rs | 4 | ||||
-rw-r--r-- | cli/tests/unit/net_test.ts | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cli/ops/net.rs b/cli/ops/net.rs index 57dcecab7..76abcb6c3 100644 --- a/cli/ops/net.rs +++ b/cli/ops/net.rs @@ -244,11 +244,11 @@ fn op_datagram_send( })?; let socket = &mut resource.socket; - socket + let byte_length = socket .send_to(&zero_copy, &resource.local_addr.as_pathname().unwrap()) .await?; - Ok(json!({})) + Ok(json!(byte_length)) }; Ok(JsonOp::Async(op.boxed_local())) diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts index 9228315d8..bd0e489b5 100644 --- a/cli/tests/unit/net_test.ts +++ b/cli/tests/unit/net_test.ts @@ -290,7 +290,8 @@ unitTest( assertEquals(bob.addr.path, filePath); const sent = new Uint8Array([1, 2, 3]); - await alice.send(sent, bob.addr); + const byteLength = await alice.send(sent, bob.addr); + assertEquals(byteLength, 3); const [recvd, remote] = await bob.receive(); assert(remote.transport === "unixpacket"); |