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,
source: "}}",
},
TemplateToken {
kind: Whitespace,
source: "
",
},
],
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,4 +3,4 @@ source: tests/file_tests.rs
expression: output
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
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();
insta::assert_debug_snapshot!("parsed", parsed);
insta::assert_debug_snapshot!("1-parsed", parsed);
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);
insta::assert_debug_snapshot!("instructions", emit);
insta::assert_debug_snapshot!("3-instructions", emit);
let output = temple::eval::execute(&emit, &context).unwrap();
insta::assert_debug_snapshot!("output", output);
insta::assert_debug_snapshot!("4-output", output);
});
}