Radish alpha
r
rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt
Git libraries for Radicle
Radicle
Git
radicle-git radicle-git-ext t src gen commit author.rs
use proptest::strategy::{Just, Strategy};
use radicle_git_ext::author::{Author, Time};

use crate::gen;

pub fn author() -> impl Strategy<Value = Author> {
    gen::alphanumeric().prop_flat_map(move |name| {
        (Just(name), gen::alphanumeric()).prop_flat_map(|(name, domain)| {
            (Just(name), Just(domain), (0..1000i64)).prop_map(move |(name, domain, time)| {
                let email = format!("{name}@{domain}");
                Author {
                    name,
                    email,
                    time: Time::new(time, 0),
                }
            })
        })
    })
}