use super::*; #[test] fn test_unconnected_component_error() { compile_and_create_component(" primitive interact_with_noone() { u8[] array = { 5 }; auto value = array[1]; }", "interact_with_noone", no_args()); } #[test] fn test_connected_uncommunicating_component_error() { compile_and_create_component(" primitive crashing_and_burning(out unused) { u8[] array = { 1337 }; auto value = array[1337]; } primitive sitting_idly_waiting(in never_providing) { sync auto a = get(never_providing); } composite constructor() { channel a -> b; new sitting_idly_waiting(b); new crashing_and_burning(a); }", "constructor", no_args()) } #[test] fn test_connected_communicating_component_error() { compile_and_create_component(" primitive send_and_fail(out tx) { u8[] array = {}; sync { put(tx, 0); array[0] = 5; } } primitive receive_once(in rx) { sync auto a = get(rx); } composite constructor() { channel a -> b; new send_and_fail(a); new receive_once(b); } ", "constructor", no_args()) }