diff --git a/src/runtime/my_tests.rs b/src/runtime/my_tests.rs index d59d4007dfae04c3bb2d03a627ca054e9c4d495e..d702b34971338a724d540e61cbbae627f120e604 100644 --- a/src/runtime/my_tests.rs +++ b/src/runtime/my_tests.rs @@ -88,3 +88,28 @@ fn multithreaded_connect() { }) .unwrap(); } + +#[test] +fn put_no_sync() { + let mut c = Connector::new_simple(MINIMAL_PROTO.clone(), 0); + let [o, _] = c.new_port_pair(); + c.connect(Duration::from_secs(1)).unwrap(); + c.put(o, (b"hi" as &[_]).into()).unwrap(); +} + +#[test] +fn wrong_polarity_bad() { + let mut c = Connector::new_simple(MINIMAL_PROTO.clone(), 0); + let [_, i] = c.new_port_pair(); + c.connect(Duration::from_secs(1)).unwrap(); + c.put(i, (b"hi" as &[_]).into()).unwrap_err(); +} + +#[test] +fn dup_put_bad() { + let mut c = Connector::new_simple(MINIMAL_PROTO.clone(), 0); + let [o, _] = c.new_port_pair(); + c.connect(Duration::from_secs(1)).unwrap(); + c.put(o, (b"hi" as &[_]).into()).unwrap(); + c.put(o, (b"hi" as &[_]).into()).unwrap_err(); +}