Conformance Examples 0.1.0 — Render: literals-blocks¶
if-true-literal-renders-body¶
{{#if true}} always renders its body.
Template
Output
if-false-literal-renders-else¶
{{#if false}} with an else arm renders the else body.
Template
Output
if-false-literal-no-else-emits-nothing¶
{{#if false}} with no else arm emits nothing.
Template
Output
if-zero-literal-is-falsy¶
Numeric 0 literal is falsy; the else body renders.
Template
Output
if-negative-zero-decimal-is-falsy¶
Numeric -0.0 literal is falsy (matches existing 0.0 == -0.0 truthiness rule).
Template
Output
if-nonzero-number-literal-is-truthy¶
A nonzero numeric literal is truthy.
Template
Output
if-empty-string-literal-is-falsy¶
An empty-string literal is falsy.
Template
Output
if-nonempty-string-literal-is-truthy¶
A non-empty string literal is truthy (including "false" as a string).
Template
Output
if-null-literal-is-falsy¶
The null literal is falsy.
Template
Output
if-else-if-with-literal-second-arm-wins¶
{{else if}} accepts a literal expression; when the first arm is falsy and the {{else if}} literal is truthy, the second arm wins.
Template
Context
Output
if-else-if-with-falsy-literal-falls-through¶
A falsy {{else if}} literal falls through to the next arm.
Template
Context
Output
unless-null-literal-renders-body¶
{{#unless null}} renders its body (null is falsy).
Template
Output
unless-truthy-string-literal-renders-else¶
{{#unless "hi"}} renders its else body (a non-empty string is truthy).
Template
Output
unless-zero-literal-renders-body¶
{{#unless 0}} renders its body (0 is falsy).
Template
Output
with-string-literal-pushes-primitive¶
{{#with "hi"}} pushes the string primitive onto the context stack; {{ this }} inside the body resolves it.
Template
Output
with-number-literal-pushes-primitive¶
{{#with 42}} pushes the number primitive; {{ this }} inside renders "42".
Template
Output
with-true-literal-pushes-primitive¶
{{#with true}} pushes the boolean primitive; {{ this }} inside renders "true".
Template
Output
with-null-literal-pushes-null-context¶
{{#with null}} pushes a null context; {{ this }} renders "null" by the null-context convention.
Template
Output
with-string-literal-then-non-this-identifier-is-null¶
A non-this identifier inside {{#with primitive}} soft-fails and resolves to null (matches B1 identifier-resolution behavior for non-container contexts).
Template
Output
each-string-literal-falls-into-else¶
A string literal is not an iterable container; {{#each}} falls into the else arm.
Template
Output
each-number-literal-falls-into-else¶
A number literal is not an iterable container; {{#each}} falls into the else arm.
Template
Output
each-true-literal-falls-into-else¶
A boolean literal is not an iterable container; {{#each}} falls into the else arm.
Template
Output
each-null-literal-falls-into-else¶
A null literal is not an iterable container; {{#each}} falls into the else arm.
Template
Output
each-null-literal-no-else-emits-nothing¶
A non-iterable literal with no else arm emits nothing.
Template
Output
Source fixture: render/literals-blocks.json