fixed number settings 0 max validator
This commit is contained in:
@@ -237,7 +237,7 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"decumal min",
|
||||
"decimal min",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
@@ -248,7 +248,7 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"decumal min (onlyInt)",
|
||||
"decimal min (onlyInt)",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
@@ -272,7 +272,7 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"decumal max",
|
||||
"decimal max",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
@@ -283,7 +283,7 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"decumal max (onlyInt)",
|
||||
"decimal max (onlyInt)",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
@@ -307,19 +307,31 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"min > max",
|
||||
"min > max (0)",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
Name: "test",
|
||||
Min: types.Pointer(2.0),
|
||||
Max: types.Pointer(1.0),
|
||||
Max: types.Pointer(0.0),
|
||||
}
|
||||
},
|
||||
[]string{"max"},
|
||||
},
|
||||
{
|
||||
"min <= max",
|
||||
"min (0) > max",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
Name: "test",
|
||||
Min: types.Pointer(0.0),
|
||||
Max: types.Pointer(-1.0),
|
||||
}
|
||||
},
|
||||
[]string{"max"},
|
||||
},
|
||||
{
|
||||
"min == max",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
@@ -330,6 +342,18 @@ func TestNumberFieldValidateSettings(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
},
|
||||
{
|
||||
"min < max",
|
||||
func() *core.NumberField {
|
||||
return &core.NumberField{
|
||||
Id: "test",
|
||||
Name: "test",
|
||||
Min: types.Pointer(2.0),
|
||||
Max: types.Pointer(3.0),
|
||||
}
|
||||
},
|
||||
[]string{},
|
||||
},
|
||||
}
|
||||
|
||||
for _, s := range scenarios {
|
||||
|
||||
Reference in New Issue
Block a user