Experimenting with more structured ways to handle command-line input/output in Rust
//! End-to-end test for lifetime support in the `fluent_embed_derive` macro

mod common;

use common::compare_message;
use fluent_embed::localize;
use icu_locale::langid;

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

#[test]
fn local_str() {
    let name = "hi";
    compare_message(
        Greeting { name },
        format!("Hello, {name}!"),
        langid!("en-US"),
    )
}

#[test]
fn static_str() {
    const NAME: &'static str = "hi";
    compare_message(
        Greeting { name: NAME },
        format!("Hello, {NAME}!"),
        langid!("en-US"),
    )
}