tests: - name: No Interpolation desc: Mustache-free templates should render as-is. data: { } template: | Hello from {Mustache}! expected: | Hello from {Mustache}! - name: Basic Interpolation desc: Unadorned tags should interpolate content into the template. data: { subject: "world" } template: | Hello, {{subject}}! expected: | Hello, world! - name: HTML Escaping desc: Basic interpolation should be HTML escaped. data: { forbidden: '& " < >' } template: | These characters should be HTML escaped: {{forbidden}} expected: | These characters should be HTML escaped: & " < > - name: Triple Mustache desc: Triple mustaches should interpolate without HTML escaping. data: { forbidden: '& " < >' } template: | These characters should not be HTML escaped: {{{forbidden}}} expected: | These characters should not be HTML escaped: & " < > - name: Ampersand desc: Ampersand should interpolate without HTML escaping. data: { forbidden: '& " < >' } template: | These characters should not be HTML escaped: {{&forbidden}} expected: | These characters should not be HTML escaped: & " < > - name: Basic Integer Interpolation desc: Integers should interpolate seamlessly. data: { mph: 85 } template: '"{{mph}} miles an hour!"' expected: '"85 miles an hour!"' - name: Triple Mustache Integer Interpolation desc: Integers should interpolate seamlessly. data: { mph: 85 } template: '"{{{mph}}} miles an hour!"' expected: '"85 miles an hour!"' - name: Ampersand Integer Interpolation desc: Integers should interpolate seamlessly. data: { mph: 85 } template: '"{{&mph}} miles an hour!"' expected: '"85 miles an hour!"' - name: Basic Decimal Interpolation desc: Decimals should interpolate seamlessly with proper significance. data: { power: 1.210 } template: '"{{power}} jiggawatts!"' expected: '"1.21 jiggawatts!"' - name: Triple Mustache Decimal Interpolation desc: Decimals should interpolate seamlessly with proper significance. data: { power: 1.210 } template: '"{{{power}}} jiggawatts!"' expected: '"1.21 jiggawatts!"' - name: Ampersand Decimal Interpolation desc: Decimals should interpolate seamlessly with proper significance. data: { power: 1.210 } template: '"{{&power}} jiggawatts!"' expected: '"1.21 jiggawatts!"' # Whitespace Sensitivity - name: Interpolation - Surrounding Whitespace desc: Interpolation should not alter surrounding whitespace. data: { string: '---' } template: '| {{string}} |' expected: '| --- |' - name: Triple Mustache - Surrounding Whitespace desc: Interpolation should not alter surrounding whitespace. data: { string: '---' } template: '| {{{string}}} |' expected: '| --- |' - name: Ampersand - Surrounding Whitespace desc: Interpolation should not alter surrounding whitespace. data: { string: '---' } template: '| {{&string}} |' expected: '| --- |' - name: Interpolation - Standalone desc: Standalone interpolation should not alter surrounding whitespace. data: { string: '---' } template: " {{string}}\n" expected: " ---\n" - name: Triple Mustache - Standalone desc: Standalone interpolation should not alter surrounding whitespace. data: { string: '---' } template: " {{{string}}}\n" expected: " ---\n" - name: Ampersand - Standalone desc: Standalone interpolation should not alter surrounding whitespace. data: { string: '---' } template: " {{&string}}\n" expected: " ---\n" # Whitespace Insensitivity - name: Interpolation With Padding desc: Superfluous in-tag whitespace should be ignored. data: { string: "---" } template: '|{{ string }}|' expected: '|---|' - name: Triple Mustache With Padding desc: Superfluous in-tag whitespace should be ignored. data: { string: "---" } template: '|{{{ string }}}|' expected: '|---|' - name: Ampersand With Padding desc: Superfluous in-tag whitespace should be ignored. data: { string: "---" } template: '|{{& string }}|' expected: '|---|'