Test that a calc over digits(0) or a repeat of 0 is refused, that an option of the wrong kind names its JSON kind, and that the root scope is the category
This commit is contained in:
@@ -309,6 +309,9 @@ func TestFakeStructErrors(t *testing.T) {
|
||||
{&struct {
|
||||
A int `fake:"person.first"`
|
||||
}{}, `"Ada" is not an integer`},
|
||||
{&struct {
|
||||
A int `fake:"{\"format\":\"{calc(d + 1)}\",\"d\":\"{digits(0)}\"}"`
|
||||
}{}, "{digits(0)} prints nothing, which is no number"},
|
||||
{&struct {
|
||||
A int8 `fake:"{int(0,300)}"`
|
||||
}{}, `"{int(0,300)}" is not proven within int8; narrow it to that range, or make the field int64`},
|
||||
|
||||
Reference in New Issue
Block a user