use std::collections::{BTreeMap, HashMap};

use cookie_cutter::{
    builtins::{StandardContextWorker, StandardContextualizer, StandardEscaper},
    Templates, Value,
};

fn main() {
    let t: Templates<_> =
        Templates::<StandardEscaper>::new::<StandardContextualizer, StandardContextWorker>(
            [(
                "hello.ccmtmpl",
                r"
template hello() {
    Hello World!
}
",
            )],
            HashMap::new(),
        )
        .expect("failed to compile templates");

    assert_eq!(
        t.render("hello", Value::Struct(BTreeMap::new()))
            .expect("failed to render hello template"),
        "Hello World!".to_string()
    );
}
