Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

885 B
Raw Blame
use super::colleague_emails;

fn emails(values: &[&str]) -> Vec<String> {
    values.iter().map(|value| (*value).to_owned()).collect()
}

#[test]
fn keeps_only_addresses_on_the_owners_work_domain() {
    let contacts = emails(&[
        "[email protected]",
        "[email protected]",
        "[email protected]",
        "[email protected]",
    ]);

    assert_eq!(
        colleague_emails("[email protected]", &contacts),
        emails(&["[email protected]", "[email protected]"])
    );
}

#[test]
fn consumer_domains_have_no_colleagues() {
    let contacts = emails(&["[email protected]", "[email protected]"]);

    assert!(colleague_emails("[email protected]", &contacts).is_empty());
}

#[test]
fn caps_the_number_of_colleagues() {
    let contacts: Vec<String> = (0..500).map(|i| format!("person{i}@acme.com")).collect();

    assert_eq!(colleague_emails("[email protected]", &contacts).len(), 200);
}