Fixup the testing stuff

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-06 15:09:53 +01:00
parent d3e6410ec0
commit 67b9c418ac
11 changed files with 12 additions and 30 deletions

View file

@ -37,10 +37,5 @@ ParsedTemplate {
kind: RightDelim, kind: RightDelim,
source: "}}", source: "}}",
}, },
TemplateToken {
kind: Whitespace,
source: "
",
},
], ],
} }

View file

@ -7,8 +7,7 @@ ParsedTemplate {
tokens: [ tokens: [
TemplateToken { TemplateToken {
kind: Content, kind: Content,
source: "Hello World! source: "Hello World!",
",
}, },
], ],
} }

View file

@ -30,13 +30,7 @@ TemplateAst {
source: "name", source: "name",
}, },
), ),
post_whitespace: Some( post_whitespace: None,
TemplateToken {
kind: Whitespace,
source: "
",
},
),
}, },
], ],
} }

View file

@ -8,8 +8,7 @@ TemplateAst {
StaticContent( StaticContent(
TemplateToken { TemplateToken {
kind: Content, kind: Content,
source: "Hello World! source: "Hello World!",
",
}, },
), ),
], ],

View file

@ -21,8 +21,4 @@ input_file: tests/cases/interpolation.temple
index: 0, index: 0,
}, },
}, },
AppendContent {
content: "
",
},
] ]

View file

@ -5,7 +5,6 @@ input_file: tests/cases/simple.temple
--- ---
[ [
AppendContent { AppendContent {
content: "Hello World! content: "Hello World!",
",
}, },
] ]

View file

@ -3,4 +3,4 @@ source: tests/file_tests.rs
expression: output expression: output
input_file: tests/cases/interpolation.temple input_file: tests/cases/interpolation.temple
--- ---
"Hello! I'm Hemera\n" "Hello! I'm Hemera"

View file

@ -3,4 +3,4 @@ source: tests/file_tests.rs
expression: output expression: output
input_file: tests/cases/simple.temple input_file: tests/cases/simple.temple
--- ---
"Hello World!\n" "Hello World!"

View file

@ -29,18 +29,18 @@ fn check_cases() {
let parsed = temple::parser::parse(input.into()).unwrap(); let parsed = temple::parser::parse(input.into()).unwrap();
insta::assert_debug_snapshot!("parsed", parsed); insta::assert_debug_snapshot!("1-parsed", parsed);
let ast = temple::ast::parse(parsed.tokens()).unwrap(); let ast = temple::ast::parse(parsed.tokens()).unwrap();
insta::assert_debug_snapshot!("ast", ast); insta::assert_debug_snapshot!("2-ast", ast);
let emit = temple::emit::emit_machine(ast); let emit = temple::emit::emit_machine(ast);
insta::assert_debug_snapshot!("instructions", emit); insta::assert_debug_snapshot!("3-instructions", emit);
let output = temple::eval::execute(&emit, &context).unwrap(); let output = temple::eval::execute(&emit, &context).unwrap();
insta::assert_debug_snapshot!("output", output); insta::assert_debug_snapshot!("4-output", output);
}); });
} }