Use macro per-test-file
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
605798674f
commit
06816567ff
49 changed files with 213 additions and 271 deletions
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/condition.nomo
|
||||
---
|
||||
"\n Hello World!\n\n\nmore"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/identifiers.nomo
|
||||
---
|
||||
"Foo\nFoo\nFoo\nFoo\nFoo\nFoo"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/if_else_if.nomo
|
||||
---
|
||||
"\n Hello World!\n"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/multiple.nomo
|
||||
---
|
||||
"Hi there! My name is Hemera Green"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/trim_whitespace.nomo
|
||||
---
|
||||
"Hello Hemera"
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/condition.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Hello World!\n{{ end }}\n\n{{= stuff }}"
|
||||
context:
|
||||
stuff: more
|
||||
test: true
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/condition.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Hello World!\n{{ end }}\n\n{{= stuff }}"
|
||||
context:
|
||||
stuff: more
|
||||
test: true
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/condition.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Hello World!\n{{ end }}\n\n{{= stuff }}"
|
||||
context:
|
||||
stuff: more
|
||||
test: true
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {
|
||||
10
tests/cases/condition.4-output.snap
Normal file
10
tests/cases/condition.4-output.snap
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
info:
|
||||
input: "{{ if test }}\n Hello World!\n{{ end }}\n\n{{= stuff }}"
|
||||
context:
|
||||
stuff: more
|
||||
test: true
|
||||
---
|
||||
"\n Hello World!\n\n\nmore"
|
||||
|
|
@ -4,13 +4,12 @@ expression: parsed
|
|||
info:
|
||||
input: "{{= _name }}\n{{= a_name }}\n{{= name }}\n{{= _name1 }}\n{{= _namE }}\n{{= name1 }}"
|
||||
context:
|
||||
_namE: Foo
|
||||
name1: Foo
|
||||
name: Foo
|
||||
_name: Foo
|
||||
_namE: Foo
|
||||
a_name: Foo
|
||||
name: Foo
|
||||
_name1: Foo
|
||||
input_file: tests/cases/identifiers.nomo
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -4,13 +4,12 @@ expression: ast
|
|||
info:
|
||||
input: "{{= _name }}\n{{= a_name }}\n{{= name }}\n{{= _name1 }}\n{{= _namE }}\n{{= name1 }}"
|
||||
context:
|
||||
_namE: Foo
|
||||
name1: Foo
|
||||
name: Foo
|
||||
_name: Foo
|
||||
_namE: Foo
|
||||
a_name: Foo
|
||||
name: Foo
|
||||
_name1: Foo
|
||||
input_file: tests/cases/identifiers.nomo
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -4,13 +4,12 @@ expression: emit
|
|||
info:
|
||||
input: "{{= _name }}\n{{= a_name }}\n{{= name }}\n{{= _name1 }}\n{{= _namE }}\n{{= name1 }}"
|
||||
context:
|
||||
_namE: Foo
|
||||
name1: Foo
|
||||
name: Foo
|
||||
_name: Foo
|
||||
_namE: Foo
|
||||
a_name: Foo
|
||||
name: Foo
|
||||
_name1: Foo
|
||||
input_file: tests/cases/identifiers.nomo
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {},
|
||||
14
tests/cases/identifiers.4-output.snap
Normal file
14
tests/cases/identifiers.4-output.snap
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
info:
|
||||
input: "{{= _name }}\n{{= a_name }}\n{{= name }}\n{{= _name1 }}\n{{= _namE }}\n{{= name1 }}"
|
||||
context:
|
||||
name1: Foo
|
||||
_name: Foo
|
||||
_namE: Foo
|
||||
a_name: Foo
|
||||
name: Foo
|
||||
_name1: Foo
|
||||
---
|
||||
"Foo\nFoo\nFoo\nFoo\nFoo\nFoo"
|
||||
|
|
@ -1,7 +1,12 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/if_else_if.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Not Hello World! :C\n{{ else if another_test }}\n Hello World!\n{{ end }}"
|
||||
context:
|
||||
test: false
|
||||
stuff: more
|
||||
another_test: true
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,12 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/if_else_if.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Not Hello World! :C\n{{ else if another_test }}\n Hello World!\n{{ end }}"
|
||||
context:
|
||||
test: false
|
||||
stuff: more
|
||||
another_test: true
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,12 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/if_else_if.nomo
|
||||
info:
|
||||
input: "{{ if test }}\n Not Hello World! :C\n{{ else if another_test }}\n Hello World!\n{{ end }}"
|
||||
context:
|
||||
test: false
|
||||
stuff: more
|
||||
another_test: true
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {
|
||||
11
tests/cases/if_else_if.4-output.snap
Normal file
11
tests/cases/if_else_if.4-output.snap
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
info:
|
||||
input: "{{ if test }}\n Not Hello World! :C\n{{ else if another_test }}\n Hello World!\n{{ end }}"
|
||||
context:
|
||||
test: false
|
||||
stuff: more
|
||||
another_test: true
|
||||
---
|
||||
"\n Hello World!\n"
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/interpolation.nomo
|
||||
info:
|
||||
input: "Hello! I'm {{= name }}"
|
||||
context:
|
||||
name: Hemera
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/interpolation.nomo
|
||||
info:
|
||||
input: "Hello! I'm {{= name }}"
|
||||
context:
|
||||
name: Hemera
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/interpolation.nomo
|
||||
info:
|
||||
input: "Hello! I'm {{= name }}"
|
||||
context:
|
||||
name: Hemera
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {},
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/interpolation.nomo
|
||||
info:
|
||||
input: "Hello! I'm {{= name }}"
|
||||
context:
|
||||
name: Hemera
|
||||
---
|
||||
"Hello! I'm Hemera"
|
||||
|
|
@ -4,7 +4,6 @@ expression: parsed
|
|||
info:
|
||||
input: "{{ if true }}\n Hello World!\n{{ end }}"
|
||||
context: {}
|
||||
input_file: tests/cases/literals.nomo
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -4,7 +4,6 @@ expression: ast
|
|||
info:
|
||||
input: "{{ if true }}\n Hello World!\n{{ end }}"
|
||||
context: {}
|
||||
input_file: tests/cases/literals.nomo
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -4,7 +4,6 @@ expression: emit
|
|||
info:
|
||||
input: "{{ if true }}\n Hello World!\n{{ end }}"
|
||||
context: {}
|
||||
input_file: tests/cases/literals.nomo
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {
|
||||
|
|
@ -4,6 +4,5 @@ expression: output
|
|||
info:
|
||||
input: "{{ if true }}\n Hello World!\n{{ end }}"
|
||||
context: {}
|
||||
input_file: tests/cases/literals.nomo
|
||||
---
|
||||
"\n Hello World!\n"
|
||||
|
|
@ -4,7 +4,6 @@ expression: parsed
|
|||
info:
|
||||
input: "{{= 5 * 3 }}\n{{= 2 * 3 + 4 * 3 }}\n{{= 3 / 3 + 3 }}"
|
||||
context: {}
|
||||
input_file: tests/cases/maths.nomo
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -4,7 +4,6 @@ expression: ast
|
|||
info:
|
||||
input: "{{= 5 * 3 }}\n{{= 2 * 3 + 4 * 3 }}\n{{= 3 / 3 + 3 }}"
|
||||
context: {}
|
||||
input_file: tests/cases/maths.nomo
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -4,7 +4,6 @@ expression: emit
|
|||
info:
|
||||
input: "{{= 5 * 3 }}\n{{= 2 * 3 + 4 * 3 }}\n{{= 3 / 3 + 3 }}"
|
||||
context: {}
|
||||
input_file: tests/cases/maths.nomo
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {},
|
||||
|
|
@ -4,6 +4,5 @@ expression: output
|
|||
info:
|
||||
input: "{{= 5 * 3 }}\n{{= 2 * 3 + 4 * 3 }}\n{{= 3 / 3 + 3 }}"
|
||||
context: {}
|
||||
input_file: tests/cases/maths.nomo
|
||||
---
|
||||
"15\n18\n4"
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/multiple.nomo
|
||||
info:
|
||||
input: "Hi there! My name is {{= name }} {{= lastname }}"
|
||||
context:
|
||||
name: Hemera
|
||||
lastname: Green
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/multiple.nomo
|
||||
info:
|
||||
input: "Hi there! My name is {{= name }} {{= lastname }}"
|
||||
context:
|
||||
name: Hemera
|
||||
lastname: Green
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/multiple.nomo
|
||||
info:
|
||||
input: "Hi there! My name is {{= name }} {{= lastname }}"
|
||||
context:
|
||||
name: Hemera
|
||||
lastname: Green
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {},
|
||||
10
tests/cases/multiple.4-output.snap
Normal file
10
tests/cases/multiple.4-output.snap
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
info:
|
||||
input: "Hi there! My name is {{= name }} {{= lastname }}"
|
||||
context:
|
||||
name: Hemera
|
||||
lastname: Green
|
||||
---
|
||||
"Hi there! My name is Hemera Green"
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/simple.nomo
|
||||
info:
|
||||
input: Hello World!
|
||||
context: {}
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/simple.nomo
|
||||
info:
|
||||
input: Hello World!
|
||||
context: {}
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/simple.nomo
|
||||
info:
|
||||
input: Hello World!
|
||||
context: {}
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {},
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
input_file: tests/cases/simple.nomo
|
||||
info:
|
||||
input: Hello World!
|
||||
context: {}
|
||||
---
|
||||
"Hello World!"
|
||||
|
|
@ -8,7 +8,6 @@ info:
|
|||
values:
|
||||
- one
|
||||
- two
|
||||
input_file: tests/cases/simple_for.nomo
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -8,7 +8,6 @@ info:
|
|||
values:
|
||||
- one
|
||||
- two
|
||||
input_file: tests/cases/simple_for.nomo
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -8,7 +8,6 @@ info:
|
|||
values:
|
||||
- one
|
||||
- two
|
||||
input_file: tests/cases/simple_for.nomo
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {
|
||||
|
|
@ -8,6 +8,5 @@ info:
|
|||
values:
|
||||
- one
|
||||
- two
|
||||
input_file: tests/cases/simple_for.nomo
|
||||
---
|
||||
"one\ntwo\n\nNo Values >:C"
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
input_file: tests/cases/trim_whitespace.nomo
|
||||
info:
|
||||
input: "{{ if test -}}\n Hello {{= stuff -}}\n{{- end }}"
|
||||
context:
|
||||
stuff: Hemera
|
||||
test: true
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/trim_whitespace.nomo
|
||||
info:
|
||||
input: "{{ if test -}}\n Hello {{= stuff -}}\n{{- end }}"
|
||||
context:
|
||||
stuff: Hemera
|
||||
test: true
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: emit
|
||||
input_file: tests/cases/trim_whitespace.nomo
|
||||
info:
|
||||
input: "{{ if test -}}\n Hello {{= stuff -}}\n{{- end }}"
|
||||
context:
|
||||
stuff: Hemera
|
||||
test: true
|
||||
---
|
||||
VMInstructions {
|
||||
labels: {
|
||||
10
tests/cases/trim_whitespace.4-output.snap
Normal file
10
tests/cases/trim_whitespace.4-output.snap
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: output
|
||||
info:
|
||||
input: "{{ if test -}}\n Hello {{= stuff -}}\n{{- end }}"
|
||||
context:
|
||||
stuff: Hemera
|
||||
test: true
|
||||
---
|
||||
"Hello Hemera"
|
||||
Loading…
Add table
Add a link
Reference in a new issue