diff --git a/README.md b/README.md index faf3445..baa5949 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ A Rust library and command line tool for generating fake data in different langu | Simplified Chinese | zh_cn | | Japanese | ja_jp | | Portugese (Brazilian) | pt_br | +| German | de_de | ## Installation diff --git a/fake/src/faker/mod.rs b/fake/src/faker/mod.rs index b8ff368..3b4bc55 100644 --- a/fake/src/faker/mod.rs +++ b/fake/src/faker/mod.rs @@ -42,6 +42,8 @@ macro_rules! def_fakers { def_fakers!(@m ar_sa=>AR_SA {$($name$(< $($lts),* >)?($($arg:$typ),*);)+}); def_fakers!(@m ja_jp=>JA_JP {$($name$(< $($lts),* >)?($($arg:$typ),*);)+}); def_fakers!(@m pt_br=>PT_BR {$($name$(< $($lts),* >)?($($arg:$typ),*);)+}); + def_fakers!(@m de_de=>DE_DE {$($name$(< $($lts),* >)?($($arg:$typ),*);)+}); + }; } diff --git a/fake/src/locales/de_de.rs b/fake/src/locales/de_de.rs new file mode 100644 index 0000000..41c5a89 --- /dev/null +++ b/fake/src/locales/de_de.rs @@ -0,0 +1,401 @@ +use rand::Rng; + +use crate::{faker::{address::de_de::{CityPrefix, CitySuffix}, name::de_de::{LastName, Name}}, locales::Data, Fake}; +#[allow(non_camel_case_types)] +#[derive(Copy, Clone)] +pub struct DE_DE; + +impl Data for DE_DE { + const NAME_FIRST_NAME: &'static [&'static str] = &[ + "Erika", // German ID Card + "André", + "Johanna", + "Edeltraut", + "Lisbeth", + "Ağça", + "Hans", + "Günther", + "Annekathrin", + "Karl", + "Lilly", + "Hildegard", + "Maija", // EU Citizen Card + "Tomáš", + "Karel", + "Maria", + "Elena", + "Inês", + "Paddy", + "Åsa", + "Maria", + "Ursula", // 50 most common female first names + "Monika", + "Petra", + "Elisabeth", + "Sabine", + "Renate", + "Helga", + "Karin", + "Brigitte", + "Ingrid", + "Erika", + "Andrea", + "Gisela", + "Claudia", + "Susanne", + "Gabriele", + "Christa", + "Christine", + "Hildegard", + "Anna", + "Birgit", + "Barbara", + "Gertrud", + "Heike", + "Marianne", + "Elke", + "Martina", + "Angelika", + "Irmgard", + "Inge", + "Ute", + "Elfriede", + "Doris", + "Marion", + "Ruth", + "Ulrike", + "Hannelore", + "Jutta", + "Gerda", + "Kerstin", + "Ilse", + "Anneliese", + "Margarete", + "Ingeborg", + "Anja", + "Edith", + "Sandra", + "Waltraud", + "Beate", + "Peter", + "Wolfgang", // 50 most common male firstnames + "Michael", + "Werner", + "Klaus", + "Thomas", + "Manfred", + "Helmut", + "Jürgen", + "Heinz", + "Gerhard", + "Andreas", + "Hans", + "Josef", + "Günter", + "Dieter", + "Horst", + "Walter", + "Frank", + "Bernd", + "Karl", + "Herbert", + "Franz", + "Martin", + "Uwe", + "Georg", + "Heinrich", + "Stefan", + "Christian", + "Karl-Heinz", + "Rudolf", + "Kurt", + "Hermann", + "Johann", + "Wilhelm", + "Siegfried", + "Rolf", + "Joachim", + "Alfred", + "Rainer", + "Jörg", + "Ralf", + "Erich", + "Norbert", + "Bernhard", + "Willi", + "Alexander", + "Ulrich", + "Markus", + "Matthias", + ]; + const NAME_LAST_NAME: &'static [&'static str] = &[ + "Mustermann", // German ID Card + "Musterfrau", + "Gabler", + "Müller-Schwarzenberg", + "Ćosić", + "Özm̂en", + "Drebenbusch-Dalgoßen", + "Lerch", + "Hillebrandt", + "Schuster", + "Meikäläinen", // EU Citizen Card + "Vomáčka", + "Rudaí", + "Lærke", + "Müller", + "Schmidt", // 100 most common german lastnames + "Schneider", + "Fischer", + "Weber", + "Meyer", + "Wagner", + "Becker", + "Schulz", + "Hoffmann", + "Schäfer", + "Bauer", + "Koch", + "Richter", + "Klein", + "Wolf", + "Schröder", + "Neumann", + "Schwarz", + "Braun", + "Hofmann", + "Zimmermann", + "Schmitt", + "Hartmann", + "Krüger", + "Schmid", + "Werner", + "Lange", + "Schmitz", + "Meier", + "Krause", + "Maier", + "Lehmann", + "Huber", + "Mayer", + "Herrmann", + "Köhler", + "Walter", + "König", + "Schulze", + "Fuchs", + "Kaiser", + "Lang", + "Weiß", + "Peters", + "Scholz", + "Jung", + "Möller", + "Hahn", + "Keller", + "Vogel", + "Schubert", + "Roth", + "Frank", + "Friedrich", + "Beck", + "Günther", + "Berger", + "Winkler", + "Lorenz", + "Baumann", + "Schuster", + "Kraus", + "Böhm", + "Simon", + "Franke", + "Albrecht", + "Winter", + "Ludwig", + "Martin", + "Krämer", + "Schumacher", + "Vogt", + "Jäger", + "Stein", + "Otto", + "Groß", + "Sommer", + "Haas", + "Graf", + "Heinrich", + "Seidel", + "Schreiber", + "Ziegler", + "Brandt", + "Kuhn", + "Schulte", + "Dietrich", + "Kühn", + "Engel", + "Pohl", + "Horn", + "Sauer", + "Arnold", + "Thomas", + "Bergmann", + "Busch", + "Pfeiffer", + "Voigt", + "Götz", + ]; + const NAME_TITLE: &'static [&'static str] = &["Frau", "Herr"]; + + const ADDRESS_STATE: &'static [&'static str] = &[ + "Baden-Württemberg", + "Bayern", + "Berlin", + "Brandenburg", + "Bremen", + "Hamburg", + "Hessen", + "Mecklenburg-Vorpommern", + "Niedersachsen", + "Nordrhein-Westfalen", + "Rheinland-Pfalz", + "Saarland", + "Sachsen", + "Sachsen-Anhalt", + "Schleswig-Holstein", + "Thüringen", + ]; + + const ADDRESS_STATE_ABBR: &'static [&'static str] = &[ + "BW", "BY", "BE", "BB", "HB", "HH", "HE", "MV", "NI", "NW", "RP", "SL", "SN", "ST", "SH", + "TH", + ]; + + const ADDRESS_COUNTRY: &'static [&'static str] = &["Deutschland", "Germany"]; + const ADDRESS_CITY_SUFFIX: &'static [&'static str] = &[ + "berg", "burg", "feld", "furt", "heim", "ing", "kirchen", "stadt", + ]; + + const ADDRESS_CITY_PREFIX: &'static [&'static str] = + &["Alt", "Bad", "Groß", "Hohen", "Klein", "Neu", "Alt", "Ober", "Unter"]; + const ADDRESS_ZIP_FORMATS: &'static [&'static str] = &["#####"]; + const ADDRESS_STREET_SUFFIX: &'static [&'static str] = &[ + "allee", "gang", "gasse", "pfad", "platz", "steg", "straße", "ufer", "weg", + ]; + const ADDRESS_SECONDARY_ADDR_TYPE: &'static [&'static str] = + &["Hof", "Gebäude", "Etage", "Eingang", "Aufgang"]; + + const ADDRESS_STREET_TPL: &'static str = "{StreetName}{StreetSuffix}"; + + const COMPANY_SUFFIX: &'static [&'static str] = &[ + "OHG", + "KG", + "GbR", + "AG", + "GmbH", + "UG", + "eG", + "Stiftung", + "e.V.", + "und Partner", + "& Partner", + ]; + + const ADDRESS_CITY_GEN_FN: OptionString> = Some( || -> String { + + // this should come from the main.rs thread_rng + // and not be instantiated here on the fly + let mut rng = rand::thread_rng(); + + // german cities are often suffixed by a river name + const RIVERS: [&str; 10] = [ + "(Rhein)", + "(Elbe)", + "(Donau)", + "(Main)", + "(Weser)", + "(Oder)", + "(Neckar)", + "(Havel)", + "(Mosel)", + "(Ems)", + ]; + + // common formats for city names + const ADDRESS_CITY_WITHOUT_PREFIX: &str = "{CityName}{CitySuffix}"; + const ADDRESS_CITY_WITHOUT_SPACE: &str = "{CityPrefix}{CityName}{CitySuffix}"; + const ADDRESS_CITY_WITH_SPACE: &str = "{CityPrefix} {CityName}{CitySuffix}"; + const ADDRESS_CITY_WITH_DASH_TPL: &str = "{CityPrefix}-{CityName}{CitySuffix}"; + const ADDRESS_CITY_WITH_RIVER_TPL: &str = "{CityPrefix}-{CityName}{CitySuffix} {River}"; + + let result = match (0..5).fake_with_rng::(&mut rng) { + + 0 => ADDRESS_CITY_WITHOUT_SPACE + .replace( + "{CityPrefix}", + CityPrefix().fake_with_rng::<&str, _>(&mut rng), + ) + .replace( + "{CityName}", + (LastName().fake_with_rng::(&mut rng)).to_lowercase().as_ref() + ) + .replace( + "{CitySuffix}", + CitySuffix().fake_with_rng::<&str, _>(&mut rng), + ), + 1 => ADDRESS_CITY_WITH_SPACE + .replace( + "{CityPrefix}", + CityPrefix().fake_with_rng::<&str, _>(&mut rng), + ) + .replace( + "{CityName}", + LastName().fake_with_rng::(&mut rng).as_ref() + ) + .replace( + "{CitySuffix}", + CitySuffix().fake_with_rng::<&str, _>(&mut rng), + ), + 2 => ADDRESS_CITY_WITH_DASH_TPL + .replace( + "{CityPrefix}", + CityPrefix().fake_with_rng::<&str, _>(&mut rng), + ) + .replace( + "{CityName}", + Name().fake_with_rng::(&mut rng).as_ref(), + ) + .replace( + "{CitySuffix}", + CitySuffix().fake_with_rng::<&str, _>(&mut rng), + ), + 3 => ADDRESS_CITY_WITH_RIVER_TPL + .replace( + "{CityPrefix}", + CityPrefix().fake_with_rng::<&str, _>(&mut rng), + ) + .replace( + "{CityName}", + Name().fake_with_rng::(&mut rng).as_ref(), + ) + .replace( + "{CitySuffix}", + CitySuffix().fake_with_rng::<&str, _>(&mut rng), + ) + .replace( + "{River}", + RIVERS[rng.gen_range(0..RIVERS.len())], + ), + _ => ADDRESS_CITY_WITHOUT_PREFIX + .replace( + "{CityName}", + Name().fake_with_rng::(&mut rng).as_ref(), + ) + .replace( + "{CitySuffix}", + CitySuffix().fake_with_rng::<&str, _>(&mut rng), + ), + }; + + result + }); +} diff --git a/fake/src/locales/mod.rs b/fake/src/locales/mod.rs index 23cf7aa..d2523ee 100644 --- a/fake/src/locales/mod.rs +++ b/fake/src/locales/mod.rs @@ -225,3 +225,6 @@ pub use self::ar_sa::AR_SA; mod pt_br; pub use self::pt_br::PT_BR; + +mod de_de; +pub use self::de_de::DE_DE; diff --git a/fake/tests/determinism.rs b/fake/tests/determinism.rs index affa68f..a0f52ef 100644 --- a/fake/tests/determinism.rs +++ b/fake/tests/determinism.rs @@ -26,13 +26,15 @@ macro_rules! check_determinism { ($op:expr; $name:ident, $ty:ty) => { check_determinism!(one $name, $ty, $op); }; - (l10d $op:expr; $ty:ty, $name_en:ident, $name_fr:ident, $name_cn:ident, $name_tw:ident, $name_ja:ident, $name_br:ident $(, $attrs:expr)*) => { + (l10d $op:expr; $ty:ty, $name_en:ident, $name_fr:ident, $name_cn:ident, $name_tw:ident, $name_ja:ident, $name_br:ident, $name_de:ident $(, $attrs:expr)*) => { check_determinism!(one $name_en, $ty, $op(EN $(, $attrs)*)); check_determinism!(one $name_fr, $ty, $op(FR_FR $(, $attrs)*)); check_determinism!(one $name_cn, $ty, $op(ZH_CN $(, $attrs)*)); check_determinism!(one $name_tw, $ty, $op(ZH_TW $(, $attrs)*)); check_determinism!(one $name_ja, $ty, $op(JA_JP $(, $attrs)*)); check_determinism!(one $name_br, $ty, $op(PT_BR $(, $attrs)*)); + check_determinism!(one $name_de, $ty, $op(DE_DE $(, $attrs)*)); + }; } @@ -47,24 +49,24 @@ check_determinism! { one fake_u64_range, u64, (1u64..54683546546434) } // Address use fake::faker::address::raw::*; -check_determinism! { l10d BuildingNumber; String, fake_buildingnumber_en, fake_buildingnumber_fr, fake_buildingnumber_cn, fake_buildingnumber_tw, fake_buildingnumber_jp, fake_buildingnumber_br } -check_determinism! { l10d CityName; String, fake_cityname_en, fake_cityname_fr, fake_cityname_cn, fake_cityname_tw, fake_cityname_jp, fake_cityname_br } -check_determinism! { l10d CityPrefix; String, fake_cityprefix_en, fake_cityprefix_fr, fake_cityprefix_cn, fake_cityprefix_tw, fake_cityprefix_jp, fake_cityprefix_br } -check_determinism! { l10d CitySuffix; String, fake_citysuffix_en, fake_citysuffix_fr, fake_citysuffix_cn, fake_citysuffix_tw, fake_citysuffix_jp, fake_citysuffix_br } -check_determinism! { l10d CountryCode; String, fake_countrycode_en, fake_countrycode_fr, fake_countrycode_cn, fake_countrycode_tw, fake_countrycode_jp, fake_countrycode_br } -check_determinism! { l10d CountryName; String, fake_countryname_en, fake_countryname_fr, fake_countryname_cn, fake_countryname_tw, fake_countryname_jp, fake_countryname_br } -check_determinism! { l10d Geohash; String, fake_geohash_en, fake_geohash_fr, fake_geohash_cn, fake_geohash_tw, fake_geohash_jp,fake_geohash_br, 11 } -check_determinism! { l10d Latitude; String, fake_latitude_en, fake_latitude_fr, fake_latitude_cn, fake_latitude_tw, fake_latitude_jp, fake_latitude_br } -check_determinism! { l10d Longitude; String, fake_longitude_en, fake_longitude_fr, fake_longitude_cn, fake_longitude_tw, fake_longitude_jp, fake_longitude_br } -check_determinism! { l10d PostCode; String, fake_postcode_en, fake_postcode_fr, fake_postcode_cn, fake_postcode_tw, fake_postcode_jp, fake_postcode_br } -check_determinism! { l10d SecondaryAddress; String, fake_secondary_address_en, fake_secondary_address_fr, fake_secondary_address_cn, fake_secondary_address_tw, fake_secondary_address_jp, fake_secondary_address_br } -check_determinism! { l10d SecondaryAddressType; String, fake_secondary_address_type_en, fake_secondary_address_type_fr, fake_secondary_address_type_cn, fake_secondary_address_type_tw, fake_secondary_address_type_jp, fake_secondary_address_type_br } -check_determinism! { l10d StateAbbr; String, fake_state_abbr_en, fake_state_abbr_fr, fake_state_abbr_cn, fake_state_abbr_tw, fake_state_abbr_jp, fake_state_abbr_br } -check_determinism! { l10d StateName; String, fake_state_name_en, fake_state_name_fr, fake_state_name_cn, fake_state_name_tw, fake_state_name_jp, fake_state_name_br } -check_determinism! { l10d StreetName; String, fake_street_name_en, fake_street_name_fr, fake_street_name_cn, fake_street_name_tw, fake_street_name_jp, fake_street_name_br } -check_determinism! { l10d StreetSuffix; String, fake_street_suffix_en, fake_street_suffix_fr, fake_street_suffix_cn, fake_street_suffix_tw, fake_street_suffix_jp, fake_street_suffix_br } -check_determinism! { l10d TimeZone; String, fake_time_zone_en, fake_time_zone_fr, fake_time_zone_cn, fake_time_zone_tw, fake_time_zone_jp, fake_time_zone_br } -check_determinism! { l10d ZipCode; String, fake_zip_code_en, fake_zip_code_fr, fake_zip_code_cn, fake_zip_code_tw, fake_zip_code_jp, fake_zip_code_br } +check_determinism! { l10d BuildingNumber; String, fake_buildingnumber_en, fake_buildingnumber_fr, fake_buildingnumber_cn, fake_buildingnumber_tw, fake_buildingnumber_jp, fake_buildingnumber_br , fake_buildingnumber_de} +check_determinism! { l10d CityName; String, fake_cityname_en, fake_cityname_fr, fake_cityname_cn, fake_cityname_tw, fake_cityname_jp, fake_cityname_br, fake_cityname_de } +check_determinism! { l10d CityPrefix; String, fake_cityprefix_en, fake_cityprefix_fr, fake_cityprefix_cn, fake_cityprefix_tw, fake_cityprefix_jp, fake_cityprefix_br, fake_cityprefix_de} +check_determinism! { l10d CitySuffix; String, fake_citysuffix_en, fake_citysuffix_fr, fake_citysuffix_cn, fake_citysuffix_tw, fake_citysuffix_jp, fake_citysuffix_br, fake_citysuffix_de } +check_determinism! { l10d CountryCode; String, fake_countrycode_en, fake_countrycode_fr, fake_countrycode_cn, fake_countrycode_tw, fake_countrycode_jp, fake_countrycode_br, fake_countrycode_de } +check_determinism! { l10d CountryName; String, fake_countryname_en, fake_countryname_fr, fake_countryname_cn, fake_countryname_tw, fake_countryname_jp, fake_countryname_br, fake_countryname_de } +check_determinism! { l10d Geohash; String, fake_geohash_en, fake_geohash_fr, fake_geohash_cn, fake_geohash_tw, fake_geohash_jp,fake_geohash_br, fake_geohash_de, 11 } +check_determinism! { l10d Latitude; String, fake_latitude_en, fake_latitude_fr, fake_latitude_cn, fake_latitude_tw, fake_latitude_jp, fake_latitude_br, fake_latitude_de } +check_determinism! { l10d Longitude; String, fake_longitude_en, fake_longitude_fr, fake_longitude_cn, fake_longitude_tw, fake_longitude_jp, fake_longitude_br, fake_longitude_de } +check_determinism! { l10d PostCode; String, fake_postcode_en, fake_postcode_fr, fake_postcode_cn, fake_postcode_tw, fake_postcode_jp, fake_postcode_br, fake_postcode_de } +check_determinism! { l10d SecondaryAddress; String, fake_secondary_address_en, fake_secondary_address_fr, fake_secondary_address_cn, fake_secondary_address_tw, fake_secondary_address_jp, fake_secondary_address_br, fake_secondary_address_de } +check_determinism! { l10d SecondaryAddressType; String, fake_secondary_address_type_en, fake_secondary_address_type_fr, fake_secondary_address_type_cn, fake_secondary_address_type_tw, fake_secondary_address_type_jp, fake_secondary_address_type_br, fake_secondary_address_type_de } +check_determinism! { l10d StateAbbr; String, fake_state_abbr_en, fake_state_abbr_fr, fake_state_abbr_cn, fake_state_abbr_tw, fake_state_abbr_jp, fake_state_abbr_br, fake_state_abbr_de } +check_determinism! { l10d StateName; String, fake_state_name_en, fake_state_name_fr, fake_state_name_cn, fake_state_name_tw, fake_state_name_jp, fake_state_name_br, fake_state_name_de } +check_determinism! { l10d StreetName; String, fake_street_name_en, fake_street_name_fr, fake_street_name_cn, fake_street_name_tw, fake_street_name_jp, fake_street_name_br, fake_street_name_de } +check_determinism! { l10d StreetSuffix; String, fake_street_suffix_en, fake_street_suffix_fr, fake_street_suffix_cn, fake_street_suffix_tw, fake_street_suffix_jp, fake_street_suffix_br, fake_street_suffix_de } +check_determinism! { l10d TimeZone; String, fake_time_zone_en, fake_time_zone_fr, fake_time_zone_cn, fake_time_zone_tw, fake_time_zone_jp, fake_time_zone_br, fake_time_zone_de } +check_determinism! { l10d ZipCode; String, fake_zip_code_en, fake_zip_code_fr, fake_zip_code_cn, fake_zip_code_tw, fake_zip_code_jp, fake_zip_code_br, fake_zip_code_de } // Administrative use fake::faker::administrative::raw::*; @@ -152,18 +154,18 @@ mod time { // Company use fake::faker::company::raw::*; -check_determinism! { l10d Bs; String, fake_bs_en, fake_bs_fr, fake_bs_cn, fake_bs_tw, fake_bs_jp, fake_bs_br } -check_determinism! { l10d BsAdj; String, fake_bs_adj_en, fake_bs_adj_fr, fake_bs_adj_cn, fake_bs_adj_tw, fake_bs_adj_jp, fake_bs_adj_br } -check_determinism! { l10d BsNoun; String, fake_bs_noun_en, fake_bs_noun_fr, fake_bs_noun_cn, fake_bs_noun_tw, fake_bs_noun_jp, fake_bs_noun_br } -check_determinism! { l10d BsVerb; String, fake_bs_verb_en, fake_bs_verb_fr, fake_bs_verb_cn, fake_bs_verb_tw, fake_bs_verb_jp, fake_bs_verb_br } -check_determinism! { l10d Buzzword; String, fake_buzzword_en, fake_buzzword_fr, fake_buzzword_cn, fake_buzzword_tw, fake_buzzword_jp, fake_buzzword_br } -check_determinism! { l10d BuzzwordMiddle; String, fake_buzzword_middle_en, fake_buzzword_middle_fr, fake_buzzword_middle_cn, fake_buzzword_middle_tw, fake_buzzword_middle_jp, fake_buzzword_middle_br } -check_determinism! { l10d BuzzwordTail; String, fake_buzzword_tail_en, fake_buzzword_tail_fr, fake_buzzword_tail_cn, fake_buzzword_tail_tw, fake_buzzword_tail_jp, fake_buzzword_tail_br } -check_determinism! { l10d CatchPhrase; String, fake_catchphrase_en, fake_catchphrase_fr, fake_catchphrase_cn, fake_catchphrase_tw, fake_catchphrase_jp, fake_catchphrase_br } -check_determinism! { l10d CompanyName; String, fake_company_name_en, fake_company_name_fr, fake_company_name_cn, fake_company_name_tw, fake_company_name_jp, fake_company_name_br } -check_determinism! { l10d CompanySuffix; String, fake_company_suffix_en, fake_company_suffix_fr, fake_company_suffix_cn, fake_company_suffix_tw, fake_company_suffix_jp, fake_company_suffix_br } -check_determinism! { l10d Industry; String, fake_industry_en, fake_industry_fr, fake_industry_cn, fake_industry_tw, fake_industry_jp, fake_industry_br } -check_determinism! { l10d Profession; String, fake_profession_en, fake_profession_fr, fake_profession_cn, fake_profession_tw, fake_profession_jp, fake_profession_br } +check_determinism! { l10d Bs; String, fake_bs_en, fake_bs_fr, fake_bs_cn, fake_bs_tw, fake_bs_jp, fake_bs_br, fake_bs_de } +check_determinism! { l10d BsAdj; String, fake_bs_adj_en, fake_bs_adj_fr, fake_bs_adj_cn, fake_bs_adj_tw, fake_bs_adj_jp, fake_bs_adj_br, fake_bs_adj_de } +check_determinism! { l10d BsNoun; String, fake_bs_noun_en, fake_bs_noun_fr, fake_bs_noun_cn, fake_bs_noun_tw, fake_bs_noun_jp, fake_bs_noun_br,fake_bs_noun_de } +check_determinism! { l10d BsVerb; String, fake_bs_verb_en, fake_bs_verb_fr, fake_bs_verb_cn, fake_bs_verb_tw, fake_bs_verb_jp, fake_bs_verb_br, fake_bs_verb_de } +check_determinism! { l10d Buzzword; String, fake_buzzword_en, fake_buzzword_fr, fake_buzzword_cn, fake_buzzword_tw, fake_buzzword_jp, fake_buzzword_br, fake_buzzword_de } +check_determinism! { l10d BuzzwordMiddle; String, fake_buzzword_middle_en, fake_buzzword_middle_fr, fake_buzzword_middle_cn, fake_buzzword_middle_tw, fake_buzzword_middle_jp, fake_buzzword_middle_br,fake_buzzword_middle_de } +check_determinism! { l10d BuzzwordTail; String, fake_buzzword_tail_en, fake_buzzword_tail_fr, fake_buzzword_tail_cn, fake_buzzword_tail_tw, fake_buzzword_tail_jp, fake_buzzword_tail_br, fake_buzzword_tail_de} +check_determinism! { l10d CatchPhrase; String, fake_catchphrase_en, fake_catchphrase_fr, fake_catchphrase_cn, fake_catchphrase_tw, fake_catchphrase_jp, fake_catchphrase_br, fake_catchphrase_de } +check_determinism! { l10d CompanyName; String, fake_company_name_en, fake_company_name_fr, fake_company_name_cn, fake_company_name_tw, fake_company_name_jp, fake_company_name_br, fake_company_name_de } +check_determinism! { l10d CompanySuffix; String, fake_company_suffix_en, fake_company_suffix_fr, fake_company_suffix_cn, fake_company_suffix_tw, fake_company_suffix_jp, fake_company_suffix_br, fake_company_suffix_de } +check_determinism! { l10d Industry; String, fake_industry_en, fake_industry_fr, fake_industry_cn, fake_industry_tw, fake_industry_jp, fake_industry_br, fake_industry_de } +check_determinism! { l10d Profession; String, fake_profession_en, fake_profession_fr, fake_profession_cn, fake_profession_tw, fake_profession_jp, fake_profession_br, fake_profession_de } // Credit Card use fake::faker::creditcard::raw::*; @@ -174,9 +176,9 @@ check_determinism! { one fake_credit_card_number_en, String, CreditCardNumber(EN // Currency use fake::faker::currency::raw::*; -check_determinism! { l10d CurrencyCode; String, fake_currency_code_en, fake_currency_code_fr, fake_currency_code_cn, fake_currency_code_tw, fake_currency_code_jp, fake_currency_code_br } -check_determinism! { l10d CurrencyName; String, fake_currency_name_en, fake_currency_name_fr, fake_currency_name_cn, fake_currency_name_tw, fake_currency_name_jp, fake_currency_name_br } -check_determinism! { l10d CurrencySymbol; String, fake_currency_symbol_en, fake_currency_symbol_fr, fake_currency_symbol_cn, fake_currency_symbol_tw, fake_currency_symbol_jp, fake_currency_symbol_br } +check_determinism! { l10d CurrencyCode; String, fake_currency_code_en, fake_currency_code_fr, fake_currency_code_cn, fake_currency_code_tw, fake_currency_code_jp, fake_currency_code_br, fake_currency_code_de } +check_determinism! { l10d CurrencyName; String, fake_currency_name_en, fake_currency_name_fr, fake_currency_name_cn, fake_currency_name_tw, fake_currency_name_jp, fake_currency_name_br, fake_currency_name_de } +check_determinism! { l10d CurrencySymbol; String, fake_currency_symbol_en, fake_currency_symbol_fr, fake_currency_symbol_cn, fake_currency_symbol_tw, fake_currency_symbol_jp, fake_currency_symbol_br, fake_currency_symbol_de } // Filesystem use fake::faker::filesystem::raw::*; @@ -191,8 +193,8 @@ check_determinism! { one fake_semver_en, String, Semver(EN) } // Finance use fake::faker::finance::raw::*; -check_determinism! { l10d Bic; String, fake_bic_en, fake_bic_fr, fake_bic_cn, fake_bic_tw, fake_bic_jp, fake_bic_br } -check_determinism! { l10d Isin; String, fake_isin_en, fake_isin_fr, fake_isin_cn, fake_isin_tw, fake_isin_jp, fake_isin_br } +check_determinism! { l10d Bic; String, fake_bic_en, fake_bic_fr, fake_bic_cn, fake_bic_tw, fake_bic_jp, fake_bic_br, fake_bic_de } +check_determinism! { l10d Isin; String, fake_isin_en, fake_isin_fr, fake_isin_cn, fake_isin_tw, fake_isin_jp, fake_isin_br, fake_isin_de } // HTTP #[cfg(feature = "http")] @@ -207,17 +209,17 @@ mod http { // Internet use fake::faker::internet::raw::*; -check_determinism! { l10d DomainSuffix; String, fake_domainsuffix_en, fake_domainsuffix_fr, fake_domainsuffix_cn, fake_domainsuffix_tw, fake_domainsuffix_jp, fake_domainsuffix_br } -check_determinism! { l10d FreeEmailProvider; String, fake_freeemailprovider_en, fake_freeemailprovider_fr, fake_freeemailprovider_cn, fake_freeemailprovider_tw, fake_freeemailprovider_jp, fake_freeemailprovider_br } -check_determinism! { l10d FreeEmail; String, fake_freeemail_en, fake_freeemail_fr, fake_freeemail_cn, fake_freeemail_tw, fake_freeemail_jp, fake_freeemail_br } -check_determinism! { l10d IP; std::net::IpAddr, fake_ip_en, fake_ip_fr, fake_ip_cn, fake_ip_tw, fake_ip_jp, fake_ip_br } -check_determinism! { l10d IPv4; String, fake_ipv4_en, fake_ipv4_fr, fake_ipv4_cn, fake_ipv4_tw, fake_ipv4_jp, fake_ipv4_br } -check_determinism! { l10d IPv6; String, fake_ipv6_en, fake_ipv6_fr, fake_ipv6_cn, fake_ipv6_tw, fake_ipv6_jp, fake_ipv6_br } -check_determinism! { l10d MACAddress; String, fake_macaddress_en, fake_macaddress_fr, fake_macaddress_cn, fake_macaddress_tw, fake_macaddress_jp, fake_macaddress_br } -check_determinism! { l10d Password; String, fake_password_en, fake_password_fr, fake_password_cn, fake_password_tw, fake_password_jp, fake_password_br, 6..12 } -check_determinism! { l10d SafeEmail; String, fake_safeemail_en, fake_safeemail_fr, fake_safeemail_cn, fake_safeemail_tw, fake_safeemail_jp, fake_safeemail_br } -check_determinism! { l10d UserAgent; String, fake_useragent_en, fake_useragent_fr, fake_useragent_cn, fake_useragent_tw, fake_useragent_jp, fake_useragent_br } -check_determinism! { l10d Username; String, fake_username_en, fake_username_fr, fake_username_cn, fake_username_tw, fake_username_jp, fake_username_br } +check_determinism! { l10d DomainSuffix; String, fake_domainsuffix_en, fake_domainsuffix_fr, fake_domainsuffix_cn, fake_domainsuffix_tw, fake_domainsuffix_jp, fake_domainsuffix_br, fake_domainsuffix_de } +check_determinism! { l10d FreeEmailProvider; String, fake_freeemailprovider_en, fake_freeemailprovider_fr, fake_freeemailprovider_cn, fake_freeemailprovider_tw, fake_freeemailprovider_jp, fake_freeemailprovider_br, fake_freeemailprovider_de } +check_determinism! { l10d FreeEmail; String, fake_freeemail_en, fake_freeemail_fr, fake_freeemail_cn, fake_freeemail_tw, fake_freeemail_jp, fake_freeemail_br, fake_freeemail_de } +check_determinism! { l10d IP; std::net::IpAddr, fake_ip_en, fake_ip_fr, fake_ip_cn, fake_ip_tw, fake_ip_jp, fake_ip_br, fake_ip_de } +check_determinism! { l10d IPv4; String, fake_ipv4_en, fake_ipv4_fr, fake_ipv4_cn, fake_ipv4_tw, fake_ipv4_jp, fake_ipv4_br, fake_ipv4_de } +check_determinism! { l10d IPv6; String, fake_ipv6_en, fake_ipv6_fr, fake_ipv6_cn, fake_ipv6_tw, fake_ipv6_jp, fake_ipv6_br, fake_ipv6_de } +check_determinism! { l10d MACAddress; String, fake_macaddress_en, fake_macaddress_fr, fake_macaddress_cn, fake_macaddress_tw, fake_macaddress_jp, fake_macaddress_br, fake_macaddress_de } +check_determinism! { l10d Password; String, fake_password_en, fake_password_fr, fake_password_cn, fake_password_tw, fake_password_jp, fake_password_br, fake_password_de, 6..12 } +check_determinism! { l10d SafeEmail; String, fake_safeemail_en, fake_safeemail_fr, fake_safeemail_cn, fake_safeemail_tw, fake_safeemail_jp, fake_safeemail_br, fake_safeemail_de } +check_determinism! { l10d UserAgent; String, fake_useragent_en, fake_useragent_fr, fake_useragent_cn, fake_useragent_tw, fake_useragent_jp, fake_useragent_br, fake_useragent_de } +check_determinism! { l10d Username; String, fake_username_en, fake_username_fr, fake_username_cn, fake_username_tw, fake_username_jp, fake_username_br, fake_username_de } // it's sufficient to check one language, because it doesn't change anything #[cfg(feature = "ulid")] @@ -244,46 +246,46 @@ mod job { use fake::{faker::job::raw::*, locales::*, Fake}; use rand::SeedableRng as _; - check_determinism! { l10d Field; String, fake_field_en, fake_field_fr, fake_field_cn, fake_field_tw, fake_field_jp, fake_field_br } - check_determinism! { l10d Position; String, fake_position_en, fake_position_fr, fake_position_cn, fake_position_tw, fake_position_jp, fake_position_br } - check_determinism! { l10d Seniority; String, fake_seniority_en, fake_seniority_fr, fake_seniority_cn, fake_seniority_tw, fake_seniority_jp, fake_seniority_br } - check_determinism! { l10d Title; String, fake_title_en, fake_title_fr, fake_title_cn, fake_title_tw, fake_title_jp, fake_title_br } + check_determinism! { l10d Field; String, fake_field_en, fake_field_fr, fake_field_cn, fake_field_tw, fake_field_jp, fake_field_br,fake_field_de } + check_determinism! { l10d Position; String, fake_position_en, fake_position_fr, fake_position_cn, fake_position_tw, fake_position_jp, fake_position_br, fake_position_de } + check_determinism! { l10d Seniority; String, fake_seniority_en, fake_seniority_fr, fake_seniority_cn, fake_seniority_tw, fake_seniority_jp, fake_seniority_br, fake_seniority_de } + check_determinism! { l10d Title; String, fake_title_en, fake_title_fr, fake_title_cn, fake_title_tw, fake_title_jp, fake_title_br, fake_title_de } } // Lorem use fake::faker::lorem::raw::*; -check_determinism! { l10d Paragraph; String, fake_paragraph_en, fake_paragraph_fr, fake_paragraph_cn, fake_paragraph_tw, fake_paragraph_jp, fake_paragraph_br, 1..3 } -check_determinism! { l10d Paragraphs; Vec, fake_paragraphs_en, fake_paragraphs_fr, fake_paragraphs_cn, fake_paragraphs_tw, fake_paragraphs_jp, fake_paragraphs_br, 1..3 } -check_determinism! { l10d Sentence; String, fake_sentence_en, fake_sentence_fr, fake_sentence_cn, fake_sentence_tw, fake_sentence_jp, fake_sentence_br, (1..3) } -check_determinism! { l10d Sentences; Vec, fake_sentences_en, fake_sentences_fr, fake_sentences_cn, fake_sentences_tw, fake_sentences_jp, fake_sentences_br, (1..3) } -check_determinism! { l10d Word; String, fake_word_en, fake_word_fr, fake_word_cn, fake_word_tw, fake_word_jp, fake_word_br } -check_determinism! { l10d Words; Vec, fake_words_en, fake_words_fr, fake_words_cn, fake_words_tw, fake_words_jp, fake_words_br, (1..3) } +check_determinism! { l10d Paragraph; String, fake_paragraph_en, fake_paragraph_fr, fake_paragraph_cn, fake_paragraph_tw, fake_paragraph_jp, fake_paragraph_br, fake_paragraph_de, 1..3 } +check_determinism! { l10d Paragraphs; Vec, fake_paragraphs_en, fake_paragraphs_fr, fake_paragraphs_cn, fake_paragraphs_tw, fake_paragraphs_jp, fake_paragraphs_br, fake_paragraphs_de, 1..3 } +check_determinism! { l10d Sentence; String, fake_sentence_en, fake_sentence_fr, fake_sentence_cn, fake_sentence_tw, fake_sentence_jp, fake_sentence_br, fake_sentence_de, (1..3) } +check_determinism! { l10d Sentences; Vec, fake_sentences_en, fake_sentences_fr, fake_sentences_cn, fake_sentences_tw, fake_sentences_jp, fake_sentences_br, fake_sentences_de, (1..3) } +check_determinism! { l10d Word; String, fake_word_en, fake_word_fr, fake_word_cn, fake_word_tw, fake_word_jp, fake_word_br, fake_word_de } +check_determinism! { l10d Words; Vec, fake_words_en, fake_words_fr, fake_words_cn, fake_words_tw, fake_words_jp, fake_words_br, fake_words_de, (1..3) } // Names mod name { use fake::{faker::name::raw::*, locales::*, Fake}; use rand::SeedableRng as _; - check_determinism! { l10d Name; String, fake_name_en, fake_name_fr, fake_name_cn, fake_name_tw, fake_name_jp, fake_name_br } - check_determinism! { l10d FirstName; String, fake_first_name_en, fake_first_name_fr, fake_first_name_cn, fake_first_name_tw, fake_first_name_jp, fake_first_name_br } - check_determinism! { l10d LastName; String, fake_last_name_en, fake_last_name_fr, fake_last_name_cn, fake_last_name_tw, fake_last_name_jp, fake_last_name_br } - check_determinism! { l10d NameWithTitle; String, fake_name_with_title_en, fake_name_with_title_fr, fake_name_with_title_cn, fake_name_with_title_tw, fake_name_with_title_jp, fake_name_with_title_br } - check_determinism! { l10d Title; String, fake_title_en, fake_title_fr, fake_title_cn, fake_title_tw, fake_title_jp, fake_title_br } - check_determinism! { l10d Suffix; String, fake_suffix_en, fake_suffix_fr, fake_suffix_cn, fake_suffix_tw, fake_suffix_jp, fake_suffix_br } + check_determinism! { l10d Name; String, fake_name_en, fake_name_fr, fake_name_cn, fake_name_tw, fake_name_jp, fake_name_br, fake_name_de } + check_determinism! { l10d FirstName; String, fake_first_name_en, fake_first_name_fr, fake_first_name_cn, fake_first_name_tw, fake_first_name_jp, fake_first_name_br, fake_first_name_de } + check_determinism! { l10d LastName; String, fake_last_name_en, fake_last_name_fr, fake_last_name_cn, fake_last_name_tw, fake_last_name_jp, fake_last_name_br , fake_last_name_de} + check_determinism! { l10d NameWithTitle; String, fake_name_with_title_en, fake_name_with_title_fr, fake_name_with_title_cn, fake_name_with_title_tw, fake_name_with_title_jp, fake_name_with_title_br, fake_name_with_title_de } + check_determinism! { l10d Title; String, fake_title_en, fake_title_fr, fake_title_cn, fake_title_tw, fake_title_jp, fake_title_br, fake_title_de } + check_determinism! { l10d Suffix; String, fake_suffix_en, fake_suffix_fr, fake_suffix_cn, fake_suffix_tw, fake_suffix_jp, fake_suffix_br, fake_suffix_jde} } // Numbers use fake::faker::number::raw::*; -check_determinism! { l10d Digit; String, fake_digit_en, fake_digit_fr, fake_digit_cn, fake_digit_tw, fake_digit_jp, fake_digit_br } -check_determinism! { l10d NumberWithFormat; String, fake_number_en, fake_number_fr, fake_number_cn, fake_number_tw, fake_number_jp, fake_number_br, "{}" } +check_determinism! { l10d Digit; String, fake_digit_en, fake_digit_fr, fake_digit_cn, fake_digit_tw, fake_digit_jp, fake_digit_br,fake_digit_de } +check_determinism! { l10d NumberWithFormat; String, fake_number_en, fake_number_fr, fake_number_cn, fake_number_tw, fake_number_jp, fake_number_br,fake_number_de, "{}" } // Phone Numbers use fake::faker::phone_number::raw::*; -check_determinism! { l10d CellNumber; String, fake_cell_number_en, fake_cell_number_fr, fake_cell_number_cn, fake_cell_number_tw, fake_cell_number_jp, fake_cell_number_br } -check_determinism! { l10d PhoneNumber; String, fake_phone_number_en, fake_phone_number_fr, fake_phone_number_cn, fake_phone_number_tw, fake_phone_number_jp, fake_phone_number_br } +check_determinism! { l10d CellNumber; String, fake_cell_number_en, fake_cell_number_fr, fake_cell_number_cn, fake_cell_number_tw, fake_cell_number_jp, fake_cell_number_br, fake_cell_number_de } +check_determinism! { l10d PhoneNumber; String, fake_phone_number_en, fake_phone_number_fr, fake_phone_number_cn, fake_phone_number_tw, fake_phone_number_jp, fake_phone_number_br, fake_phone_number_de } #[cfg(feature = "geo-types")] mod geo {