added extra validators for the collection int64 field options
This commit is contained in:
@@ -200,7 +200,7 @@ func TestJSONFieldValidateSettings(t *testing.T) {
|
||||
expectErrors []string
|
||||
}{
|
||||
{
|
||||
"< 0 MaxSize",
|
||||
"MaxSize < 0",
|
||||
func() *core.JSONField {
|
||||
return &core.JSONField{
|
||||
Id: "test",
|
||||
@@ -211,7 +211,7 @@ func TestJSONFieldValidateSettings(t *testing.T) {
|
||||
[]string{"maxSize"},
|
||||
},
|
||||
{
|
||||
"= 0 MaxSize",
|
||||
"MaxSize = 0",
|
||||
func() *core.JSONField {
|
||||
return &core.JSONField{
|
||||
Id: "test",
|
||||
@@ -221,7 +221,7 @@ func TestJSONFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"> 0 MaxSize",
|
||||
"MaxSize > 0",
|
||||
func() *core.JSONField {
|
||||
return &core.JSONField{
|
||||
Id: "test",
|
||||
@@ -231,6 +231,17 @@ func TestJSONFieldValidateSettings(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"MaxSize > safe json int",
|
||||
func() *core.JSONField {
|
||||
return &core.JSONField{
|
||||
Id: "test",
|
||||
Name: "test",
|
||||
MaxSize: 1 << 53,
|
||||
}
|
||||
},
|
||||
[]string{"maxSize"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, s := range scenarios {
|
||||
|
||||
Reference in New Issue
Block a user