Tests for reference sigils: / the root, . this folder, .. the folder above
Tests / vet + fmt + tests (pull_request) Failing after 37s

This commit is contained in:
2026-09-02 18:24:58 +02:00
parent 1b1b93b35f
commit fcc58a74ab
7 changed files with 122 additions and 75 deletions
+3 -3
View File
@@ -16,8 +16,8 @@ func TestList(t *testing.T) {
"person": `{"format":"{first} {last}","first":"A","last":"B"}`,
"word": `["x", "y"]`,
"geo/city": `"Z"`,
// A bound {..path} reference is a render edge, not an addressable field.
"greeting": `{"format":"hej {..person.first} and {own}","own":"x"}`,
// A bound {/path} reference is a render edge, not an addressable field.
"greeting": `{"format":"hej {/person.first} and {own}","own":"x"}`,
// Only the fields every variant carries are addressable, so "extra" is not.
"coin": `[{"format":"{code}","code":"A","name":"Aa"},{"format":"{code}","code":"B","name":"Bb","extra":"x"}]`,
})
@@ -186,7 +186,7 @@ func TestRepeatProductAlongAPathIsCapped(t *testing.T) {
for name, files := range map[string]map[string]string{
"nested": {"cat": `{"format":"{a}","repeat":2048,"a":{"format":"{b}","repeat":2048,"b":"x"}}`},
"through a reference": {
"a": `{"format":"{..b}","repeat":2048}`,
"a": `{"format":"{/b}","repeat":2048}`,
"b": `{"format":"x","repeat":2048}`,
},
} {