pub const POPULAR_DOMAINS: &[&str] = &[
"gmail.com",
"yahoo.com",
"outlook.com",
"hotmail.com",
"icloud.com",
"aol.com",
"live.com",
"msn.com",
"protonmail.com",
"mail.com",
"yandex.com",
"zoho.com",
"fastmail.com",
"tutanota.com",
"gmx.com",
"docomo.ne.jp",
"ezweb.ne.jp",
"softbank.ne.jp",
"au.com",
"rakuten.jp",
"i.softbank.jp",
"vodafone.ne.jp",
"yahoo.co.jp",
"yahoo.co.uk",
"yahoo.fr",
"yahoo.de",
"yahoo.es",
"yahoo.it",
"yahoo.com.br",
"yahoo.com.au",
"yahoo.ca",
"company.com",
"business.com",
"office.com",
"enterprise.com",
"edu",
"ac.uk",
"edu.au",
"edu.br",
"gov",
"gov.uk",
"gov.au",
"gov.ca",
"example.com",
"test.com",
"demo.com",
];
pub const SECOND_LEVEL_DOMAINS: &[&str] = &[
"gmail",
"yahoo",
"outlook",
"hotmail",
"icloud",
"aol",
"live",
"msn",
"mail",
"protonmail",
"yandex",
"zoho",
"fastmail",
"tutanota",
"gmx",
"docomo",
"ezweb",
"softbank",
"rakuten",
"vodafone",
"company",
"business",
"office",
"enterprise",
"example",
"test",
"demo",
"admin",
"info",
"support",
"contact",
"sales",
"help",
"service",
];
pub const TOP_LEVEL_DOMAINS: &[&str] = &[
"com",
"org",
"net",
"edu",
"gov",
"mil",
"int",
"info",
"biz",
"name",
"pro",
"museum",
"app",
"dev",
"tech",
"online",
"site",
"website",
"email",
"work",
"business",
"company",
"enterprise",
"solutions",
"services",
"consulting",
"agency",
"studio",
"design",
"digital",
"media",
"news",
"blog",
"store",
"shop",
"market",
"finance",
"bank",
"insurance",
"health",
"medical",
"legal",
"law",
"travel",
"hotel",
"restaurant",
"food",
"game",
"games",
"sport",
"sports",
"music",
"art",
"photo",
"video",
"film",
"tv",
"radio",
"social",
"community",
"club",
"group",
"team",
"family",
"kids",
"baby",
"love",
"life",
"world",
"earth",
"global",
"international",
"local",
"city",
"town",
"country",
"region",
"us", "uk", "ca", "au", "de", "fr", "it", "es", "nl", "be", "ch", "at", "se", "no", "dk", "fi", "pl", "cz", "hu", "gr", "pt", "ie", "jp", "cn", "kr", "in", "sg", "hk", "tw", "th", "my", "id", "ph", "vn", "br", "mx", "ar", "cl", "co", "pe", "za", "eg", "tr", "il", "ae", "sa", "ru", "ua", "by", "kz", "uz", "co.uk",
"co.jp",
"co.kr",
"co.in",
"co.za",
"co.nz",
"com.au",
"com.br",
"com.mx",
"com.ar",
"com.co",
"com.pe",
"com.tr",
"com.eg",
"com.sa",
"com.ae",
"com.my",
"com.sg",
"com.hk",
"com.tw",
"com.th",
"com.ph",
"com.vn",
"com.id",
"org.uk",
"net.au",
"edu.au",
"gov.au",
"edu.br",
"gov.br",
"ac.uk",
"ac.jp",
"ac.kr",
"ac.in",
"ac.za",
"ne.jp",
"edu.in",
"gov.in",
"org.in",
"net.in",
];
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_no_duplicates_in_popular_domains() {
let mut unique_domains = std::collections::HashSet::new();
for domain in POPULAR_DOMAINS {
assert!(
unique_domains.insert(domain),
"Duplicate domain found: {domain}"
);
}
}
#[test]
fn test_no_duplicates_in_slds() {
let mut unique_slds = std::collections::HashSet::new();
for sld in SECOND_LEVEL_DOMAINS {
assert!(unique_slds.insert(sld), "Duplicate SLD found: {sld}");
}
}
#[test]
fn test_no_duplicates_in_tlds() {
let mut unique_tlds = std::collections::HashSet::new();
for tld in TOP_LEVEL_DOMAINS {
assert!(unique_tlds.insert(tld), "Duplicate TLD found: {tld}");
}
}
}