diff --git a/src/runtime2/tests/internet.rs b/src/runtime2/tests/internet.rs index 601a6e486d9eb5ef61df9a328b2ff0074ff411ce..abb4204bf432e7c207110f3f37c9c2d75b41a429 100644 --- a/src/runtime2/tests/internet.rs +++ b/src/runtime2/tests/internet.rs @@ -7,17 +7,17 @@ fn test_stdlib_file() { compile_and_create_component(" import std.internet as inet; - primitive fake_listener_once(out tx) { + comp fake_listener_once(out tx) { channel cmd_tx -> cmd_rx; channel data_tx -> data_rx; - new fake_client(cmd_rx, data_tx); + new fake_socket(cmd_rx, data_tx); sync put(tx, inet::TcpConnection{ tx: cmd_tx, rx: data_rx, }); } - primitive fake_socket(in cmds, out tx) { + comp fake_socket(in cmds, out tx) { auto to_send = {}; auto shutdown = false; @@ -25,10 +25,10 @@ fn test_stdlib_file() { auto keep_going = true; sync { while (keep_going) { - let cmd = get(cmds); + auto cmd = get(cmds); if (let inet::Cmd::Send(data) = cmd) { to_send = data; - } else if (let inet::Cmd::Receive(data) = cmd) { + } else if (let inet::Cmd::Receive = cmd) { put(tx, to_send); } else if (let inet::Cmd::Finish = cmd) { keep_going = false; @@ -41,7 +41,7 @@ fn test_stdlib_file() { } } - primitive fake_client(inet::TcpConnection conn) { + comp fake_client(inet::TcpConnection conn) { sync put(conn.tx, inet::Cmd::Send({1, 3, 3, 7})); sync { put(conn.tx, inet::Cmd::Receive); @@ -52,7 +52,7 @@ fn test_stdlib_file() { sync put(conn.tx, inet::Cmd::Shutdown); } - composite constructor() { + comp constructor() { channel conn_tx -> conn_rx; new fake_listener_once(conn_tx);