summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-02-06 10:05:14 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-02-06 10:05:14 +0100
commit7eeaf41b1177ddfe70f70203afa499f04bb8de2d (patch)
treee5fc2e9d4378b6dda6c9fb91b789da64d76315ae /src
parent1c15ddfd97afeba755ab591c205785f9be7608e1 (diff)
parentec1b76dd28c90894200fc0a19fa964643e815cbf (diff)
downloadmullvadvpn-7eeaf41b1177ddfe70f70203afa499f04bb8de2d.tar.xz
mullvadvpn-7eeaf41b1177ddfe70f70203afa499f04bb8de2d.zip
Merge branch 'assert_matches'
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs4
-rw-r--r--src/process/monitor.rs5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1b3cf59b66..81225be473 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,6 +2,10 @@
//! The core components of the talpidaemon VPN client.
+#[cfg(test)]
+#[macro_use]
+extern crate assert_matches;
+
extern crate clonablechild;
/// Working with processes.
diff --git a/src/process/monitor.rs b/src/process/monitor.rs
index a9d6c0b36b..e8d32a7973 100644
--- a/src/process/monitor.rs
+++ b/src/process/monitor.rs
@@ -247,10 +247,7 @@ mod child_monitor {
macro_rules! assert_event {
($rx:ident, $expected:pat) => {{
let result = $rx.recv_timeout(Duration::new(1, 0));
- if let $expected = result {} else {
- let msg = stringify!($expected);
- panic!("Expected {}. Got {:?}", msg, result);
- }
+ assert_matches!(result, $expected);
}}
}