summaryrefslogtreecommitdiffstats
path: root/internals/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'internals/src/macros.rs')
-rw-r--r--internals/src/macros.rs38
1 files changed, 17 insertions, 21 deletions
diff --git a/internals/src/macros.rs b/internals/src/macros.rs
index ac234d7..fdab374 100644
--- a/internals/src/macros.rs
+++ b/internals/src/macros.rs
@@ -1,4 +1,3 @@
-
/// it's easy to overlook the `!` in `assert!(!this_is.really_eycatching())`
#[cfg(test)]
macro_rules! assert_not {
@@ -8,39 +7,36 @@ macro_rules! assert_not {
#[cfg(test)]
macro_rules! assert_ok {
- ($val:expr) => ({
+ ($val:expr) => {{
match $val {
- Ok( res ) => res,
- Err( err ) => panic!( "expected Ok(..) got Err({:?})", err)
+ Ok(res) => res,
+ Err(err) => panic!("expected Ok(..) got Err({:?})", err),
}
- });
- ($val:expr, $ctx:expr) => ({
+ }};
+ ($val:expr, $ctx:expr) => {{
match $val {
- Ok( res ) => res,
- Err( err ) => panic!( "expected Ok(..) got Err({:?}) [ctx: {:?}]", err, $ctx)
+ Ok(res) => res,
+ Err(err) => panic!("expected Ok(..) got Err({:?}) [ctx: {:?}]", err, $ctx),
}
- });
+ }};
}
#[cfg(test)]
macro_rules! assert_err {
- ($val:expr) => ({
+ ($val:expr) => {{
match $val {
- Ok( val ) => panic!( "expected Err(..) got Ok({:?})", val),
- Err( err ) => err,
+ Ok(val) => panic!("expected Err(..) got Ok({:?})", val),
+ Err(err) => err,
}
- });
- ($val:expr, $ctx:expr) => ({
+ }};
+ ($val:expr, $ctx:expr) => {{
match $val {
- Ok( val ) => panic!( "expected Err(..) got Ok({:?}) [ctx: {:?}]", val, $ctx),
- Err( err ) => err,
+ Ok(val) => panic!("expected Err(..) got Ok({:?}) [ctx: {:?}]", val, $ctx),
+ Err(err) => err,
}
- });
+ }};
}
-
-
-
// macro_rules! deref0 {
// (+mut $name:ident => $tp:ty) => (
// deref0!{-mut $name => $tp }
@@ -58,4 +54,4 @@ macro_rules! assert_err {
// }
// }
// );
-// } \ No newline at end of file
+// }