Browse Source

Add failing tests for #111

tags/v0.4.1
Ben Kurtovic 8 years ago
parent
commit
56f1797cfe
1 changed files with 35 additions and 12 deletions
  1. +35
    -12
      tests/tokenizer/templates.mwtest

+ 35
- 12
tests/tokenizer/templates.mwtest View File

@@ -1,17 +1,3 @@
name: blank
label: template with no content
input: "{{}}"
output: [TemplateOpen(), TemplateClose()]


name: blank_with_params
label: template with no content, but pipes and equal signs
input: "{{||=|}}"
output: [TemplateOpen(), TemplateParamSeparator(), TemplateParamSeparator(), TemplateParamEquals(), TemplateParamSeparator(), TemplateClose()]


name: no_params
label: simplest type of template
input: "{{template}}"
@@ -61,6 +47,13 @@ output: [TemplateOpen(), Text(text="foo"), TemplateParamSeparator(), Text(text="

---

name: blank_params
label: template with blank parameters (mix of pipes and equal signs)
input: "{{,||=|}}"
output: [TemplateOpen(), Text(text=","), TemplateParamSeparator(), TemplateParamSeparator(), TemplateParamEquals(), TemplateParamSeparator(), TemplateClose()]

---

name: nested_unnamed_param
label: nested template as an unnamed parameter
input: "{{foo|{{bar}}}}"
@@ -390,6 +383,34 @@ output: [TemplateOpen(), Text(text="foo\n "), TemplateParamSeparator(), Text(te

---

name: invalid_blank
label: invalid template with no content
input: "{{}}"
output: [Text(text="{{}}")]

---

name: invalid_blank_whitespace
label: invalid template with no content, but whitespace
input: "{{ }}"
output: [Text(text="{{ }}")]

---

name: invalid_blank_pipe
label: invalid template with no content, but a parameter
input: "{{|foo}}"
output: [Text(text="{{|foo}}")]

---

name: invalid_blank_whitespace_pipe
label: invalid template with no content, but whitespace and a parameter
input: "{{ |foo}}"
output: [Text(text="{{ |foo}}")]

---

name: invalid_name_left_brace_middle
label: invalid characters in template name: left brace in middle
input: "{{foo{bar}}"


Loading…
Cancel
Save