Framework for embedding localizations into Rust types
//! End-to-end test for lifetime support in the `l10n_embed_derive` macro

mod common;

use common::compare_message;
use icu_locale::{Locale, locale};
use l10n_embed_derive::localize;

const DEFAULT_LOCALE: Locale = locale!("en-US");

#[localize("tests/locale/**/basic.ftl")]
pub struct Greeting<'a> {
    name: &'a str,
}

#[localize("tests/locale/**/basic.ftl")]
pub enum Message<'a> {
    Greeting { name: &'a str },
}

#[test]
fn static_str() {
    let name = "Ferris";
    let expected = "Hello, Ferris!";

    compare_message(Greeting { name }, expected, DEFAULT_LOCALE);
    compare_message(Message::Greeting { name }, expected, DEFAULT_LOCALE);
}