move check_trait to crate root
This commit is contained in:
parent
ad1854dfb8
commit
abf76c9df7
2 changed files with 14 additions and 12 deletions
13
src/lib.rs
13
src/lib.rs
|
|
@ -13,3 +13,16 @@ mod sharry;
|
|||
pub use appstate::AppState;
|
||||
pub use cli::Cli;
|
||||
pub use error::{Error, Parameter, Result};
|
||||
|
||||
#[cfg(test)]
|
||||
#[inline]
|
||||
pub fn check_trait<E, A>(expected: &E, actual: &A, tr: &'static str, ty: &'static str)
|
||||
where
|
||||
E: std::fmt::Debug + PartialEq<A>,
|
||||
A: std::fmt::Debug,
|
||||
{
|
||||
assert_eq!(
|
||||
expected, actual,
|
||||
"`impl {tr} for {ty}` expected: {expected:?}, actual: {actual:?}",
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,18 +102,7 @@ impl TryFrom<String> for FileID {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[inline]
|
||||
fn check_trait<E, A>(expected: &E, actual: &A, tr: &'static str, ty: &'static str)
|
||||
where
|
||||
E: fmt::Debug + PartialEq<A>,
|
||||
A: fmt::Debug,
|
||||
{
|
||||
assert_eq!(
|
||||
expected, actual,
|
||||
"`impl {tr} for {ty}` expected: {expected:?}, actual: {actual:?}",
|
||||
);
|
||||
}
|
||||
use crate::check_trait;
|
||||
|
||||
#[test]
|
||||
fn basic_traits_working() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue