roadblk 0.2.0

Validator integration
Documentation
#[cfg(test)]
mod tests {
    use roadblk_expand::expand;
    use syn::{parse_quote, DeriveInput};

    #[test]
    fn test_struct_expand() -> syn::Result<()> {
        let input: DeriveInput = parse_quote! {
            #[derive(Debug, Validator)]
            pub struct Person (#[validate] pub Student);
        };
        let token_stream = expand(input).unwrap().to_string();
        println!("{token_stream}");
        Ok(())
    }

    #[test]
    fn test_enum_expand() -> syn::Result<()> {
        let input: DeriveInput = parse_quote! {
            #[derive(Debug, Validator)]
            pub enum Sex {
                Man(#[validate(range(1, 55))] i32),
                Woman {
                    #[validate(len(2, 334))]
                    #[validate(validator(MobilePhoneValidator))]
                    phone: Option<String>,
                },
            }
        };
        let token_stream = expand(input).unwrap().to_string();
        println!("{token_stream}");
        Ok(())
    }
}