//! A basic end-to-end test for the example at https://projectfluent.org/fluent/guide/selectors.html
usecli_macros::localize;useicu_locid::locale;useicu_plurals::{PluralRuleType, PluralRules};#[localize("tests/locale/**/selectors.ftl")]pubenumMessages{
Emails { unread_emails:u64},}#[test]fnselectors(){let locale =locale!("en-US");let plural_rules =PluralRules::try_new(&locale.clone().into(),PluralRuleType::Cardinal).unwrap();let test_values =[0,1,2,u64::MAX];for test_value in test_values {let correct_output =if test_value ==1{String::from("You have one unread email.")}else{format!("You have {test_value} unread emails.")};let message =Messages::Emails {
unread_emails: test_value,};assert_eq!(
message.localize(&[&locale],&plural_rules),
correct_output,"Unexpected output for unread_emails = {test_value}");}}