|
|
@ -28,6 +28,7 @@ func TestTranslations(t *testing.T) { |
|
|
|
GteCSFieldString string |
|
|
|
GteCSFieldString string |
|
|
|
LtCSFieldString string |
|
|
|
LtCSFieldString string |
|
|
|
LteCSFieldString string |
|
|
|
LteCSFieldString string |
|
|
|
|
|
|
|
RequiredWithoutField string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type Test struct { |
|
|
|
type Test struct { |
|
|
@ -36,6 +37,7 @@ func TestTranslations(t *testing.T) { |
|
|
|
RequiredNumber int `validate:"required"` |
|
|
|
RequiredNumber int `validate:"required"` |
|
|
|
RequiredMultiple []string `validate:"required"` |
|
|
|
RequiredMultiple []string `validate:"required"` |
|
|
|
RequiredIf string `validate:"required_if=Inner.RequiredIf abcd"` |
|
|
|
RequiredIf string `validate:"required_if=Inner.RequiredIf abcd"` |
|
|
|
|
|
|
|
RequiredWithout string `validate:"required_without=Inner.RequiredWithoutField"` |
|
|
|
LenString string `validate:"len=1"` |
|
|
|
LenString string `validate:"len=1"` |
|
|
|
LenNumber float64 `validate:"len=1113.00"` |
|
|
|
LenNumber float64 `validate:"len=1113.00"` |
|
|
|
LenMultiple []string `validate:"len=7"` |
|
|
|
LenMultiple []string `validate:"len=7"` |
|
|
@ -638,6 +640,10 @@ func TestTranslations(t *testing.T) { |
|
|
|
ns: "Test.UniqueMap", |
|
|
|
ns: "Test.UniqueMap", |
|
|
|
expected: "UniqueMap debe contener valores únicos", |
|
|
|
expected: "UniqueMap debe contener valores únicos", |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ns: "Test.RequiredWithout", |
|
|
|
|
|
|
|
expected: "RequiredWithout es un campo requerido cuando los campos [Inner.RequiredWithoutField] no estan presentes", |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for _, tt := range tests { |
|
|
|
for _, tt := range tests { |
|
|
|