decon-spf 0.3.3

This is a simple tool that allows you to deconstruct an existing SPF record that might be retreived in a normal DNS TXT lookup. With version 0.2.0 you can now also construct a new Spf record.
Documentation
#[cfg(not(feature = "ptr"))]
mod parse {

    use crate::SpfBuilder;
    #[test]
    fn test_exist() {
        let input = "v=spf1 ptr ~all";

        let spf: SpfBuilder = input.parse().unwrap();
        assert_eq!(spf.ptr().unwrap().qualifier().is_pass(), true);
        assert_eq!(spf.ptr().unwrap().to_string(), "ptr");
    }
    #[test]
    fn test_exist_colon() {
        let input = "v=spf1 ptr:host.example.com ~all";

        let spf: SpfBuilder = input.parse().unwrap();
        assert_eq!(spf.ptr().unwrap().qualifier().is_pass(), true);
        assert_eq!(spf.ptr().unwrap().to_string(), "ptr:host.example.com");
    }
    mod invalid {
        use super::*;
        use crate::spf::mechanism::MechanismError;
        use crate::spf::SpfError;

        #[test]
        fn exists_with_slash() {
            let input = "v=spf1 ptr:host.example.com/23 -all";

            let err = input.parse::<SpfBuilder>().unwrap_err();
            assert_eq!(
                err,
                SpfError::InvalidMechanism(MechanismError::InvalidMechanismFormat(
                    "ptr:host.example.com/23".to_string()
                ))
            )
        }
    }
}