Fixup the testing stuff
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
d3e6410ec0
commit
67b9c418ac
11 changed files with 12 additions and 30 deletions
|
|
@ -37,10 +37,5 @@ ParsedTemplate {
|
||||||
kind: RightDelim,
|
kind: RightDelim,
|
||||||
source: "}}",
|
source: "}}",
|
||||||
},
|
},
|
||||||
TemplateToken {
|
|
||||||
kind: Whitespace,
|
|
||||||
source: "
|
|
||||||
",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
@ -7,8 +7,7 @@ ParsedTemplate {
|
||||||
tokens: [
|
tokens: [
|
||||||
TemplateToken {
|
TemplateToken {
|
||||||
kind: Content,
|
kind: Content,
|
||||||
source: "Hello World!
|
source: "Hello World!",
|
||||||
",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
@ -30,13 +30,7 @@ TemplateAst {
|
||||||
source: "name",
|
source: "name",
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
post_whitespace: Some(
|
post_whitespace: None,
|
||||||
TemplateToken {
|
|
||||||
kind: Whitespace,
|
|
||||||
source: "
|
|
||||||
",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
@ -8,8 +8,7 @@ TemplateAst {
|
||||||
StaticContent(
|
StaticContent(
|
||||||
TemplateToken {
|
TemplateToken {
|
||||||
kind: Content,
|
kind: Content,
|
||||||
source: "Hello World!
|
source: "Hello World!",
|
||||||
",
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -21,8 +21,4 @@ input_file: tests/cases/interpolation.temple
|
||||||
index: 0,
|
index: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppendContent {
|
|
||||||
content: "
|
|
||||||
",
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
@ -5,7 +5,6 @@ input_file: tests/cases/simple.temple
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
AppendContent {
|
AppendContent {
|
||||||
content: "Hello World!
|
content: "Hello World!",
|
||||||
",
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -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"
|
||||||
|
|
@ -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!"
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
"name": "Hemera"
|
"name": "Hemera"
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
Hello! I'm {{= name }}
|
Hello! I'm {{= name }}
|
||||||
|
|
@ -1 +1 @@
|
||||||
Hello World!
|
Hello World!
|
||||||
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue