From e7549ddfab23e27530b3e9effaa0fff33a5f1555 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 22 Jan 2024 19:00:59 +0800 Subject: [PATCH] Update lib.rs --- src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7bf5f2e..59ab8c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -174,3 +174,18 @@ macro_rules! available_locales { crate::_rust_i18n_available_locales() }; } + +#[cfg(test)] +mod tests { + use crate::{locale, CURRENT_LOCALE}; + + fn assert_locale_type(s: &str, val: &str) { + assert_eq!(s, val); + } + + #[test] + fn test_locale() { + assert_locale_type(&locale(), &CURRENT_LOCALE.as_str()); + assert_eq!(&*locale(), "en"); + } +}