From 67b9c418aca6b4ddca713c521a5037b594432acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 6 Mar 2026 15:09:53 +0100 Subject: [PATCH] Fixup the testing stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- ...sed@interpolation.snap => 1-parsed@interpolation.snap} | 5 ----- tests/cases/{parsed@simple.snap => 1-parsed@simple.snap} | 3 +-- .../{ast@interpolation.snap => 2-ast@interpolation.snap} | 8 +------- tests/cases/{ast@simple.snap => 2-ast@simple.snap} | 3 +-- ...terpolation.snap => 3-instructions@interpolation.snap} | 4 ---- ...nstructions@simple.snap => 3-instructions@simple.snap} | 3 +-- ...put@interpolation.snap => 4-output@interpolation.snap} | 2 +- tests/cases/{output@simple.snap => 4-output@simple.snap} | 2 +- tests/cases/interpolation.temple | 2 +- tests/cases/simple.temple | 2 +- tests/file_tests.rs | 8 ++++---- 11 files changed, 12 insertions(+), 30 deletions(-) rename tests/cases/{parsed@interpolation.snap => 1-parsed@interpolation.snap} (89%) rename tests/cases/{parsed@simple.snap => 1-parsed@simple.snap} (79%) rename tests/cases/{ast@interpolation.snap => 2-ast@interpolation.snap} (81%) rename tests/cases/{ast@simple.snap => 2-ast@simple.snap} (80%) rename tests/cases/{instructions@interpolation.snap => 3-instructions@interpolation.snap} (87%) rename tests/cases/{instructions@simple.snap => 3-instructions@simple.snap} (74%) rename tests/cases/{output@interpolation.snap => 4-output@interpolation.snap} (81%) rename tests/cases/{output@simple.snap => 4-output@simple.snap} (84%) diff --git a/tests/cases/parsed@interpolation.snap b/tests/cases/1-parsed@interpolation.snap similarity index 89% rename from tests/cases/parsed@interpolation.snap rename to tests/cases/1-parsed@interpolation.snap index c0ea910..d7ffd1c 100644 --- a/tests/cases/parsed@interpolation.snap +++ b/tests/cases/1-parsed@interpolation.snap @@ -37,10 +37,5 @@ ParsedTemplate { kind: RightDelim, source: "}}", }, - TemplateToken { - kind: Whitespace, - source: " - ", - }, ], } diff --git a/tests/cases/parsed@simple.snap b/tests/cases/1-parsed@simple.snap similarity index 79% rename from tests/cases/parsed@simple.snap rename to tests/cases/1-parsed@simple.snap index a227f96..cf2fa7c 100644 --- a/tests/cases/parsed@simple.snap +++ b/tests/cases/1-parsed@simple.snap @@ -7,8 +7,7 @@ ParsedTemplate { tokens: [ TemplateToken { kind: Content, - source: "Hello World! - ", + source: "Hello World!", }, ], } diff --git a/tests/cases/ast@interpolation.snap b/tests/cases/2-ast@interpolation.snap similarity index 81% rename from tests/cases/ast@interpolation.snap rename to tests/cases/2-ast@interpolation.snap index dd6aab3..2c2b869 100644 --- a/tests/cases/ast@interpolation.snap +++ b/tests/cases/2-ast@interpolation.snap @@ -30,13 +30,7 @@ TemplateAst { source: "name", }, ), - post_whitespace: Some( - TemplateToken { - kind: Whitespace, - source: " - ", - }, - ), + post_whitespace: None, }, ], } diff --git a/tests/cases/ast@simple.snap b/tests/cases/2-ast@simple.snap similarity index 80% rename from tests/cases/ast@simple.snap rename to tests/cases/2-ast@simple.snap index cdfef72..1fd3a24 100644 --- a/tests/cases/ast@simple.snap +++ b/tests/cases/2-ast@simple.snap @@ -8,8 +8,7 @@ TemplateAst { StaticContent( TemplateToken { kind: Content, - source: "Hello World! - ", + source: "Hello World!", }, ), ], diff --git a/tests/cases/instructions@interpolation.snap b/tests/cases/3-instructions@interpolation.snap similarity index 87% rename from tests/cases/instructions@interpolation.snap rename to tests/cases/3-instructions@interpolation.snap index 0dbff6d..116329e 100644 --- a/tests/cases/instructions@interpolation.snap +++ b/tests/cases/3-instructions@interpolation.snap @@ -21,8 +21,4 @@ input_file: tests/cases/interpolation.temple index: 0, }, }, - AppendContent { - content: " - ", - }, ] diff --git a/tests/cases/instructions@simple.snap b/tests/cases/3-instructions@simple.snap similarity index 74% rename from tests/cases/instructions@simple.snap rename to tests/cases/3-instructions@simple.snap index be760cf..512e4d3 100644 --- a/tests/cases/instructions@simple.snap +++ b/tests/cases/3-instructions@simple.snap @@ -5,7 +5,6 @@ input_file: tests/cases/simple.temple --- [ AppendContent { - content: "Hello World! - ", + content: "Hello World!", }, ] diff --git a/tests/cases/output@interpolation.snap b/tests/cases/4-output@interpolation.snap similarity index 81% rename from tests/cases/output@interpolation.snap rename to tests/cases/4-output@interpolation.snap index f607ac7..f91df8c 100644 --- a/tests/cases/output@interpolation.snap +++ b/tests/cases/4-output@interpolation.snap @@ -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" diff --git a/tests/cases/output@simple.snap b/tests/cases/4-output@simple.snap similarity index 84% rename from tests/cases/output@simple.snap rename to tests/cases/4-output@simple.snap index 7e78743..31bd0cf 100644 --- a/tests/cases/output@simple.snap +++ b/tests/cases/4-output@simple.snap @@ -3,4 +3,4 @@ source: tests/file_tests.rs expression: output input_file: tests/cases/simple.temple --- -"Hello World!\n" +"Hello World!" diff --git a/tests/cases/interpolation.temple b/tests/cases/interpolation.temple index 5d0cfc9..87aa194 100644 --- a/tests/cases/interpolation.temple +++ b/tests/cases/interpolation.temple @@ -2,4 +2,4 @@ "name": "Hemera" } --- -Hello! I'm {{= name }} +Hello! I'm {{= name }} \ No newline at end of file diff --git a/tests/cases/simple.temple b/tests/cases/simple.temple index 980a0d5..c57eff5 100644 --- a/tests/cases/simple.temple +++ b/tests/cases/simple.temple @@ -1 +1 @@ -Hello World! +Hello World! \ No newline at end of file diff --git a/tests/file_tests.rs b/tests/file_tests.rs index 49e87b4..0c60c54 100644 --- a/tests/file_tests.rs +++ b/tests/file_tests.rs @@ -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); }); }