Add tests for if/else if/else/if
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
c9314a3d9b
commit
ef02e94591
3 changed files with 166 additions and 2 deletions
55
src/ast/snapshots/nomo__ast__tests__check_if_else.snap
Normal file
55
src/ast/snapshots/nomo__ast__tests__check_if_else.snap
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
source: src/ast/mod.rs
|
||||
expression: ast
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
ConditionalChain {
|
||||
chain: [
|
||||
IfConditional {
|
||||
if_block: Block {
|
||||
prev_whitespace_content: None,
|
||||
expression: VariableAccess(
|
||||
[Ident]"foo" (6..9),
|
||||
),
|
||||
post_whitespace_content: Some(
|
||||
[Whitespace]" " (12..13),
|
||||
),
|
||||
},
|
||||
},
|
||||
ConditionalContent {
|
||||
content: [
|
||||
StaticContent(
|
||||
[Content]"foo" (13..16),
|
||||
),
|
||||
],
|
||||
},
|
||||
Block {
|
||||
prev_whitespace_content: Some(
|
||||
[Whitespace]" " (16..17),
|
||||
),
|
||||
expression: ElseConditional {
|
||||
expression: None,
|
||||
},
|
||||
post_whitespace_content: Some(
|
||||
[Whitespace]" " (27..28),
|
||||
),
|
||||
},
|
||||
ConditionalContent {
|
||||
content: [
|
||||
StaticContent(
|
||||
[Content]"bar" (28..31),
|
||||
),
|
||||
],
|
||||
},
|
||||
Block {
|
||||
prev_whitespace_content: Some(
|
||||
[Whitespace]" " (31..32),
|
||||
),
|
||||
expression: EndBlock,
|
||||
post_whitespace_content: None,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue