Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee authored Jan 22, 2024
1 parent c57aa22 commit e7549dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit e7549dd

Please sign in to comment.