# This file contains tests for all known mustache syntax errors and their
# desired error messages. Each one is converted into an Odin test.
name: Missing 2nd closing brace
enable: true
should: error
input: |
| ^^^^ expected }}, got }}}
12 |
|
---
# TODO: Implement
name: Frontmatter missing closing quote on key
enable: false
should: warn
input: |
{
"title: Docs"
}
[TOC]
## Introduction
expected: 'TODO:'
actual: |
[ERROR] --- [42:parse_frontmatter()] failed to parse frontmatter JSON: Expected_Colon_After_Key
---
# TODO: Implement
name: Fronmatter missing opening quote on value
should: warn
enable: false
input: |
{
"title": Docs"
}
[TOC]
## Introduction
expected: 'detailed diagnostic pointing to the point of failure and suggesting the addition of a quote'
actual: Nothing. The page compiles with no warnings or errors
---
name: No error when missing index page
enable: true
should: error
expected: 'Your site has no index page! Please create an index.md or index.html file in ./content/'
---
# FIXME: Doesn't work properly
name: format pipe with no date format set
enable: true
should: warn
input: '{{ now | format }}'
expected: |
no date format configured — set date.format in thor.json or specify a format, e.g. {{key | format "2 Jan 2006"}}
--> :1:10
|
1 | {{now | format}}
| ^^^^^^ defaulting to "2 Jan 2006"
---
# TODO: called First/last, but only tests first
name: first/last with zero argument
enable: true
should: error
input: |
{{#items | first 0}}
{{.}}
{{/items}}
expected: |
argument must not be zero
--> :1:16
|
1 |
{{#items | first 0}}
{{.}}
{{/items}}
| ^^^^^^^
|
---
# TODO: called First/last, but only tests first
name: first/last with negative argument
enable: true
should: warn
input: |
{{#items | first -3}}
{{.}}
{{/items}}
expected: |
first -3 is equivalent to last 3
--> :1:16
|
1 |
{{#items | first -3}}
{{.}}
{{/items}}
| ^^^^^^^^ consider using the clearer form
|
---
# TODO: called First/last, but only tests first
name: first/last on string with no argument
# enable: true
input: '{{word | first}}'
should: warn
expected: |
defaulting to n=1 for string
--> :1:1
|
1 | {{word | first}}
| ^^^^^ consider specifying n explicitly
|
---
name: "first succeeds on params.author.name"
enable: true
input: '{{ params.author.name | first 3 }}'
should: ok
expected: "foo"
---
# TODO: called First/last, but only tests first
name: "first/last in partial"
enable: true
input: "{{> footer }}"
should: error
expected: |
first -3 is equivalent to last 3
--> /home/spencer/github.com/sbrow.github.io/layouts/partials/footer.html:1:1
|
1 |