Test that a default written out loads in every position, null outside a column is refused, an alternation reads a field once, and the CLI's lone reference refuses an empty segment

This commit is contained in:
2026-10-07 23:16:50 +02:00
committed by Lillem4n
parent 0b8dea0d04
commit 49736bd2b6
7 changed files with 62 additions and 27 deletions
+5 -5
View File
@@ -226,23 +226,23 @@ func TestNewErrors(t *testing.T) {
}{
"separator without repeat": {
map[string]string{"a": `{"format":"{x}","x":"1","separator":","}`},
"has no effect without a repeat above 1",
`drop "separator"`,
},
"separator with an explicit repeat of 1": {
map[string]string{"a": `{"format":"{x}","x":"1","separator":","}`},
"has no effect without a repeat above 1",
`drop "separator"`,
},
"weight outside a choice": {
map[string]string{"a": `{"format":"x","weight":5}`},
"weight only skews a choice's items",
`drop "weight"`,
},
"non-numeric weight outside a choice": {
map[string]string{"a": `{"format":"x","weight":"bad"}`},
"weight only skews a choice's items",
"takes a number, not a string",
},
"weight used as a field": {
map[string]string{"a": `{"format":"{name} {weight}kg","name":"Anvil","weight":["7"]}`},
"can never be a field",
`a field cannot be named "weight"`,
},
"an option name used as a token": {
map[string]string{"a": `"{weight}"`},