# HG changeset patch # User Martin Habovstiak # Date 1606490949 -3600 # Node ID 9731ff589d9c65fe543255fb34eeda2a821c6000 # Parent a7893294e9b22f7ddf3a284052570e4e3d07c9c9 Fix tests on non-linux systems We need to check that systemd tests fail on non-linux systems instead. diff -r a7893294e9b2 -r 9731ff589d9c src/lib.rs --- a/src/lib.rs Fri Nov 27 16:15:57 2020 +0100 +++ b/src/lib.rs Fri Nov 27 16:29:09 2020 +0100 @@ -383,11 +383,19 @@ } #[test] + #[cfg(linux)] fn parse_systemd() { assert_eq!("systemd://foo".parse::().unwrap().0, SocketAddrInner::Systemd("systemd://foo".to_owned())); } #[test] + #[cfg(not(linux))] + #[should_panic] + fn parse_systemd() { + "systemd://foo".parse::().unwrap(); + } + + #[test] #[should_panic] fn parse_systemd_fail_control() { "systemd://foo\n".parse::().unwrap(); diff -r a7893294e9b2 -r 9731ff589d9c tests/systemd.rs --- a/tests/systemd.rs Fri Nov 27 16:15:57 2020 +0100 +++ b/tests/systemd.rs Fri Nov 27 16:29:09 2020 +0100 @@ -23,6 +23,7 @@ } #[test] +#[cfg_attr(not(linux), should_panic)] fn main() { comm::main::(); }