From 98d69a42870030ad533dd8eda5da817430c2b71c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 26 Mar 2020 11:54:48 +0000 Subject: send wl::Params over socket --- msg_socket2/tests/option.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 msg_socket2/tests/option.rs (limited to 'msg_socket2/tests') diff --git a/msg_socket2/tests/option.rs b/msg_socket2/tests/option.rs new file mode 100644 index 0000000..130dd7d --- /dev/null +++ b/msg_socket2/tests/option.rs @@ -0,0 +1,12 @@ +use msg_socket2::Socket; +use sys_util::net::UnixSeqpacket; + +#[test] +fn option() { + let (f1, f2) = UnixSeqpacket::pair().unwrap(); + let s1: Socket<_, ()> = Socket::new(f1); + let s2: Socket<(), Option> = Socket::new(f2); + + s1.send(Some("hello world".to_string())).unwrap(); + assert_eq!(s2.recv().unwrap(), Some("hello world".to_string())); +} -- cgit 1.4.1