Mercurial > crates > systemd-socket
comparison src/lib.rs @ 7:9731ff589d9c
Fix tests on non-linux systems
We need to check that systemd tests fail on non-linux systems instead.
| author | Martin Habovstiak <martin.habovstiak@gmail.com> |
|---|---|
| date | Fri, 27 Nov 2020 16:29:09 +0100 |
| parents | a7893294e9b2 |
| children | 4fb70ca820a6 |
comparison
equal
deleted
inserted
replaced
| 6:a7893294e9b2 | 7:9731ff589d9c |
|---|---|
| 381 fn parse_ordinary() { | 381 fn parse_ordinary() { |
| 382 assert_eq!("127.0.0.1:42".parse::<SocketAddr>().unwrap().0, SocketAddrInner::Ordinary(([127, 0, 0, 1], 42).into())); | 382 assert_eq!("127.0.0.1:42".parse::<SocketAddr>().unwrap().0, SocketAddrInner::Ordinary(([127, 0, 0, 1], 42).into())); |
| 383 } | 383 } |
| 384 | 384 |
| 385 #[test] | 385 #[test] |
| 386 #[cfg(linux)] | |
| 386 fn parse_systemd() { | 387 fn parse_systemd() { |
| 387 assert_eq!("systemd://foo".parse::<SocketAddr>().unwrap().0, SocketAddrInner::Systemd("systemd://foo".to_owned())); | 388 assert_eq!("systemd://foo".parse::<SocketAddr>().unwrap().0, SocketAddrInner::Systemd("systemd://foo".to_owned())); |
| 389 } | |
| 390 | |
| 391 #[test] | |
| 392 #[cfg(not(linux))] | |
| 393 #[should_panic] | |
| 394 fn parse_systemd() { | |
| 395 "systemd://foo".parse::<SocketAddr>().unwrap(); | |
| 388 } | 396 } |
| 389 | 397 |
| 390 #[test] | 398 #[test] |
| 391 #[should_panic] | 399 #[should_panic] |
| 392 fn parse_systemd_fail_control() { | 400 fn parse_systemd_fail_control() { |
