Tests for an empty field name
A field named "" loads, and a bare {} token renders it, but no dot path can
reach it — List hides it and Fake cannot ask for it. {a.} is already rejected
for the same reason, so the two spellings disagree about the same mistake.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,13 @@ func TestNewErrors(t *testing.T) {
|
||||
map[string]string{"a|b": `["1"]`},
|
||||
`category "a|b" contains "|"`,
|
||||
},
|
||||
// An empty name is reachable by no dot path, so List cannot advertise it and
|
||||
// Fake cannot ask for it — {} is the one spelling that reaches it, which is
|
||||
// the same trap {a.} is already rejected for.
|
||||
"empty field name": {
|
||||
map[string]string{"a": `{"format":"[{}]","":"VALUE"}`},
|
||||
`field "" is empty`,
|
||||
},
|
||||
"folder name with a paren": {
|
||||
map[string]string{"a(b/cat": `["1"]`},
|
||||
`folder "a(b" contains "("`,
|
||||
|
||||
Reference in New Issue
Block a user