Add test for multiple interpolations
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
67b9c418ac
commit
e158450d18
5 changed files with 176 additions and 0 deletions
57
tests/cases/2-ast@multiple.snap
Normal file
57
tests/cases/2-ast@multiple.snap
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/multiple.temple
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
StaticContent(
|
||||
TemplateToken {
|
||||
kind: Content,
|
||||
source: "Hi there! My name is",
|
||||
},
|
||||
),
|
||||
Interpolation {
|
||||
prev_whitespace: Some(
|
||||
TemplateToken {
|
||||
kind: Whitespace,
|
||||
source: " ",
|
||||
},
|
||||
),
|
||||
wants_output: Some(
|
||||
TemplateToken {
|
||||
kind: WantsOutput,
|
||||
source: "=",
|
||||
},
|
||||
),
|
||||
expression: VariableAccess(
|
||||
TemplateToken {
|
||||
kind: Ident,
|
||||
source: "name",
|
||||
},
|
||||
),
|
||||
post_whitespace: Some(
|
||||
TemplateToken {
|
||||
kind: Whitespace,
|
||||
source: " ",
|
||||
},
|
||||
),
|
||||
},
|
||||
Interpolation {
|
||||
prev_whitespace: None,
|
||||
wants_output: Some(
|
||||
TemplateToken {
|
||||
kind: WantsOutput,
|
||||
source: "=",
|
||||
},
|
||||
),
|
||||
expression: VariableAccess(
|
||||
TemplateToken {
|
||||
kind: Ident,
|
||||
source: "lastname",
|
||||
},
|
||||
),
|
||||
post_whitespace: None,
|
||||
},
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue