Commit fa0fb58
feat(render-conformance): expand corpus to 14 fixtures — Mustache divergent surfaces
Original 4 fixtures (csv-injection, email, prompt, spreadsheet) only exercised
escaping + a tiny partial. Add 10 fixtures targeting known cross-implementation
divergent surfaces of the 4 Mustache engines we use (mustache.js / Stubble /
mustache.java / hand-rolled Python interpreter) — the gate that defends
prompt-cache stability.
New fixtures:
- render-inverted-section ^x over empty array, empty string, false, null, missing
- render-standalone-tag-stripping block tags (#,/,!,^,>) on their own line strip trailing newline
- render-dotted-path-lookup {{user.profile.name}} walks nested objects
- render-parent-context-fallthrough name resolves from enclosing context if not in inner section
- render-raw-html-bypass {{{x}}} and {{&x}} bypass format escaper
- render-nested-partials partial referencing partial 2 levels deep
- render-unicode-multibyte emoji + CJK + combining marks preserved byte-for-byte
- render-empty-array-falsiness empty array renders nothing; non-empty iterates
- render-falsy-values false/null/empty-string/empty-array are falsy in sections
- render-trailing-newline-preservation template w/o trailing newline → output w/o trailing newline
Cross-port status (all 4 ports' render-conformance gates green at 14/14):
- TS (mustache.js): all 10 new fixtures match expected.txt
- C# (Stubble): all 10 new fixtures match expected.txt
- Python (hand): all 10 new fixtures match expected.txt
- Java (mustache.java): 9/10 match; 1 documented drift in KNOWN_DRIFT.md —
render-standalone-tag-stripping: mustache.java does NOT apply the standalone-line
strip rule to {{! comment }} tags (TS / C# / Python all do). One extra blank line
after the comment block. Other standalone strips (section, partial) work.
Within-Java snapshot gate stays green; cross-port report flags it; KNOWN_DRIFT.md
updated.
Verification:
- TS `bun test packages/render/test/render-conformance.test.ts` 14/14 pass
- C# `dotnet test ... --filter FullyQualifiedName~RenderConformance` 14/14 pass
- Java `mvn -pl render test -Dtest=RenderSnapshotTest` 14/14 pass
- Py `uv run pytest tests/render/test_render_conformance.py -q` 14/14 pass
- No regressions in any port's broader render test suite
(TS 103/103, C# 98/98, Java 99/99, Py 81/81).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 695d1f3 commit fa0fb58
54 files changed
Lines changed: 289 additions & 1 deletion
File tree
- fixtures/render-conformance
- render-dotted-path-lookup
- render-empty-array-falsiness
- render-falsy-values
- render-inverted-section
- render-nested-partials
- partials
- render-parent-context-fallthrough
- render-raw-html-bypass
- render-standalone-tag-stripping
- partials
- render-trailing-newline-preservation
- render-unicode-multibyte
- server/java/render
- src/test/resources/snapshots
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments