tera 2.0.0-alpha.3

A template engine for Rust based on Jinja2/Django
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Build errors are errors that Tera catches when loading templates
//! eg a template inheriting from a template that isn't there
use crate::tera::Tera;

use crate::snapshot_tests::utils::{normalize_line_endings, split_multi_templates};

#[test]
fn build_errors() {
    insta::glob!("build_errors/**/*.txt", |path| {
        println!("{path:?}");
        let contents = std::fs::read_to_string(path).unwrap();
        let normalized_contents = normalize_line_endings(&contents);
        let tpls = split_multi_templates(&normalized_contents);
        let mut tera = Tera::default();
        let err = tera.add_raw_templates(tpls).unwrap_err();
        insta::assert_snapshot!(&err);
    });
}