diff --git a/src/lib.rs b/src/lib.rs index 92982f13..c02eefd9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -152,25 +152,12 @@ pub use self::{ #[cfg(test)] use { + std::assert_matches, strum::IntoDiscriminant, tempfile::TempDir, test::{assert_cbor, assert_encoding, tempdir}, }; -#[macro_export] -macro_rules! assert_matches { - ($expression:expr, $( $pattern:pat_param )|+ $( if $guard:expr )? $(,)?) => { - match $expression { - $( $pattern )|+ $( if $guard )? => {} - left => panic!( - "assertion failed: (left ~= right)\n left: `{:?}`\n right: `{}`", - left, - stringify!($($pattern)|+ $(if $guard)?) - ), - } - } -} - #[cfg(test)] macro_rules! assert_matches_regex { ($haystack:expr, $re:expr $(,)?) => {{ diff --git a/tests/lib.rs b/tests/lib.rs index a500c087..b576ccda 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -3,12 +3,13 @@ use { camino::{Utf8Path, Utf8PathBuf}, filepack::{ Decode, Decoder, Directory, Encoder, Fingerprint, Hash, Manifest, Metadata, PrivateKey, - PublicKey, assert_matches, + PublicKey, templates::{DirectoryHtml, PackageHtml, Page, PageHtml}, }, regex::Regex, reqwest::StatusCode, std::{ + assert_matches, collections::{BTreeMap, BTreeSet}, fs, io::{Read, Write},