diff --git a/src/runtime2/tests/mod.rs b/src/runtime2/tests/mod.rs index d145eddbcfaffa2ec557fe8c29f1c4fb17a18d56..110d7de0d7e3fb8ed0d9d2d13e2e15c271a6e5c0 100644 --- a/src/runtime2/tests/mod.rs +++ b/src/runtime2/tests/mod.rs @@ -35,7 +35,7 @@ pub(crate) fn no_args() -> ValueGroup { ValueGroup::new_stack(Vec::new()) } #[test] fn test_component_creation() { let pd = ProtocolDescription::parse(b" - primitive nothing_at_all() { + comp nothing_at_all() { s32 a = 5; auto b = 5 + a; } @@ -55,7 +55,7 @@ fn test_simple_select() { return (); } - primitive receiver(in in_a, in in_b, u32 num_sends) { + comp receiver(in in_a, in in_b, u32 num_sends) { auto num_from_a = 0; auto num_from_b = 0; while (num_from_a + num_from_b < 2 * num_sends) { @@ -74,7 +74,7 @@ fn test_simple_select() { } } - primitive sender(out tx, u32 num_sends) { + comp sender(out tx, u32 num_sends) { auto index = 0; while (index < num_sends) { sync { @@ -84,7 +84,7 @@ fn test_simple_select() { } } - composite constructor() { + comp constructor() { auto num_sends = 1; channel tx_a -> rx_a; channel tx_b -> rx_b; @@ -100,7 +100,7 @@ fn test_simple_select() { #[test] fn test_unguarded_select() { let pd = ProtocolDescription::parse(b" - primitive constructor_outside_select() { + comp constructor_outside_select() { u32 index = 0; while (index < 5) { sync select { auto v = () -> print(\"hello\"); } @@ -108,7 +108,7 @@ fn test_unguarded_select() { } } - primitive constructor_inside_select() { + comp constructor_inside_select() { u32 index = 0; while (index < 5) { sync select { auto v = () -> index += 1; } @@ -123,7 +123,7 @@ fn test_unguarded_select() { #[test] fn test_empty_select() { let pd = ProtocolDescription::parse(b" - primitive constructor() { + comp constructor() { u32 index = 0; while (index < 5) { sync select {} @@ -140,7 +140,7 @@ fn test_random_u32_temporary_thingo() { let pd = ProtocolDescription::parse(b" import std.random::random_u32; - primitive random_taker(in generator, u32 num_values) { + comp random_taker(in generator, u32 num_values) { auto i = 0; while (i < num_values) { sync { @@ -150,7 +150,7 @@ fn test_random_u32_temporary_thingo() { } } - composite constructor() { + comp constructor() { channel tx -> rx; auto num_values = 25; new random_u32(tx, 1, 100, num_values); @@ -166,7 +166,7 @@ fn test_tcp_socket_http_request() { let _pd = ProtocolDescription::parse(b" import std.internet::*; - primitive requester(out cmd_tx, in data_rx) { + comp requester(out cmd_tx, in data_rx) { print(\"*** TCPSocket: Sending request\"); sync { put(cmd_tx, Cmd::Send(b\"GET / HTTP/1.1\\r\\n\\r\\n\")); @@ -215,7 +215,7 @@ fn test_tcp_socket_http_request() { } } - composite main() { + comp main() { channel cmd_tx -> cmd_rx; channel data_tx -> data_rx; new tcp_client({142, 250, 179, 163}, 80, cmd_rx, data_tx); // port 80 of google @@ -237,7 +237,7 @@ fn test_sending_receiving_union() { Shutdown, } - primitive database(in rx, out tx) { + comp database(in rx, out tx) { auto stored = {}; auto done = false; while (!done) { @@ -257,7 +257,7 @@ fn test_sending_receiving_union() { } } - primitive client(out tx, in rx, u32 num_rounds) { + comp client(out tx, in rx, u32 num_rounds) { auto round = 0; while (round < num_rounds) { auto set_value = b\"hello there\"; @@ -279,7 +279,7 @@ fn test_sending_receiving_union() { sync put(tx, Cmd::Shutdown); } - composite main() { + comp main() { auto num_rounds = 5; channel cmd_tx -> cmd_rx; channel data_tx -> data_rx;