diff options
Diffstat (limited to 'src/test/fixtures/error.rs')
| -rw-r--r-- | src/test/fixtures/error.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/fixtures/error.rs b/src/test/fixtures/error.rs new file mode 100644 index 0000000..559afee --- /dev/null +++ b/src/test/fixtures/error.rs @@ -0,0 +1,14 @@ +macro_rules! expected { + ($expr:expr, $expect:pat $(,)?) => { + $crate::test::fixtures::error::expected!($expr, $expect, ()) + }; + + ($expr:expr, $expect:pat, $body:expr $(,)?) => { + match $expr { + $expect => $body, + other => panic!("expected {}, found {other:#?}", stringify!($expect)), + } + }; +} + +pub(crate) use expected; |
