traced-test 1.0.4

this crate lets us use #[traced_test] to automatically configure sane default tracing for a rust test
Documentation
// ---------------- [ File: src/get_should_fail_attr.rs ]
crate::ix!();

pub trait HasShouldFailAttr {

    fn should_fail_attr(&self) -> Option<ShouldFailAttr>;
}

pub trait MaybeHasExpectedFailureMessage {

    fn expected_failure_message(&self)
        -> Option<Cow<'_,str>>;
}

pub trait CheckForAndRetrieveTheUniqueShouldFailAttr {

    fn maybe_get_should_fail_attr(&self)
        -> Result<Option<ShouldFailAttr>, TracedTestError>;
}

impl CheckForAndRetrieveTheUniqueShouldFailAttr for &[syn::Attribute] {
    fn maybe_get_should_fail_attr(&self) -> Result<Option<ShouldFailAttr>, TracedTestError> {
        let mut should_fail_attr = None;
        for attr in *self {
            if attr.path().is_ident("should_fail") {
                if should_fail_attr.is_some() {
                    return Err(TracedTestError::MultipleShouldFailAttrs);
                }
                let parsed_attr = ShouldFailAttr::try_from(attr.clone())
                    .map_err(TracedTestError::ShouldFailAttrError)?;
                should_fail_attr = Some(parsed_attr);
            }
        }
        Ok(should_fail_attr)
    }
}