lib.rs 635 B

12345678910111213141516171819202122232425
  1. include!(concat!(env!("OUT_DIR"), "/google.languages_public.rs"));
  2. include!(concat!(env!("OUT_DIR"), "/data.rs"));
  3. #[cfg(test)]
  4. mod tests {
  5. use super::*;
  6. #[test]
  7. fn regions() {
  8. assert!((*REGIONS).contains_key("BG"));
  9. assert_eq!(REGIONS.get("BG").unwrap().name.as_deref(), Some("Bulgaria"));
  10. }
  11. #[test]
  12. fn scripts() {
  13. assert!((*SCRIPTS).contains_key("Arab"));
  14. assert_eq!(SCRIPTS.get("Arab").unwrap().name.as_deref(), Some("Arabic"));
  15. }
  16. #[test]
  17. fn languages() {
  18. assert!(LANGUAGES.len() > 1000);
  19. assert!((*LANGUAGES).contains_key("ar_Arab"));
  20. }
  21. }