Test that what is well-formed and means one thing loads: ignored parts, constant samples, any JSON value, weight 0, an unread name, a stray rows file, a tagless struct and flags with no effect
This commit is contained in:
+2
-12
@@ -224,18 +224,6 @@ func TestNewErrors(t *testing.T) {
|
||||
files map[string]string
|
||||
want string
|
||||
}{
|
||||
"separator without repeat": {
|
||||
map[string]string{"a": `{"format":"{x}","x":"1","separator":","}`},
|
||||
`drop "separator"`,
|
||||
},
|
||||
"separator with an explicit repeat of 1": {
|
||||
map[string]string{"a": `{"format":"{x}","x":"1","separator":","}`},
|
||||
`drop "separator"`,
|
||||
},
|
||||
"weight outside a choice": {
|
||||
map[string]string{"a": `{"format":"x","weight":5}`},
|
||||
`drop "weight"`,
|
||||
},
|
||||
"non-numeric weight outside a choice": {
|
||||
map[string]string{"a": `{"format":"x","weight":"bad"}`},
|
||||
"takes a number, not a string",
|
||||
@@ -341,6 +329,8 @@ func TestNewErrors(t *testing.T) {
|
||||
"field with a closing paren": {map[string]string{"a": `{"format":"{b)c}","b)c":"2"}`}, "a", "2"},
|
||||
"repeat without a separator": {map[string]string{"a": `{"format":"{x}","repeat":3,"x":"1"}`}, "a", "111"},
|
||||
"one name in two tokens": {map[string]string{"a": `{"format":"{x}{x}","x":"1"}`}, "a", "11"},
|
||||
"separator without repeat": {map[string]string{"a": `{"format":"{x}","x":"1","separator":",","repeat":1}`}, "a", "1"},
|
||||
"weight outside a choice": {map[string]string{"a": `{"format":"x","weight":5}`}, "a", "x"},
|
||||
"repeated alternation arm": {map[string]string{"a": `{"format":"{x|x}","x":"1"}`}, "a", "1"},
|
||||
"repeated path arm": {map[string]string{"a": `{"format":"{p.v|p.v}","p":{"format":"{v}","v":"1"}}`}, "a", "1"},
|
||||
"repeated reference arm": {map[string]string{"a": `"x"`, "b": `"{/a|/a}"`}, "b", "x"},
|
||||
|
||||
Reference in New Issue
Block a user