Skip to content
Snippets Groups Projects
Commit dd60bc58 authored by ko_oler's avatar ko_oler
Browse files

правки по ПР

parent ce8fef23
Branches
Tags
No related merge requests found
......@@ -93,11 +93,14 @@ func TestString(t *testing.T) {
}{
{"Length Max", field.String().AddOptions(MaxLength(5)), "1234567", true},
{"Length Max with <nil>", field.String().AddOptions(MaxLength(5)), nil, false},
{"Length Max and Required with <nil>", field.String().AddOptions(MaxLength(5), Required()), nil, true},
{"Length Min", field.String().AddOptions(MinLength(10)), "1234", true},
{"Length Min with <nil>", field.String().AddOptions(MinLength(10)), nil, false},
{"Length Min and Required with <nil>", field.String().AddOptions(MinLength(10), Required()), nil, true},
{"Length MinMax", field.String().AddOptions(MaxLength(6), MinLength(2)), "1234567", true},
{"Length MinMax", field.String().AddOptions(MaxLength(10), MinLength(7)), "123456", true},
{"Length MinMax with <nil>", field.String().AddOptions(MaxLength(10), MinLength(7)), nil, false},
{"Length MinMax and Required with <nil>", field.String().AddOptions(MaxLength(10), MinLength(7), Required()), nil, true},
{"Enum miss", field.String().AddOptions(Enum(EnumOpt{Name: "N 1", Value: "n1"}, EnumOpt{Name: "N 2", Value: "n2"})), "n3", true},
{"Enum match", field.String().AddOptions(Enum(EnumOpt{Name: "N 1", Value: "n1"}, EnumOpt{Name: "N 2", Value: "n2"})), "n2", false},
{"Invalid Schema Options", field.String().AddOptions(Schema()), invalidOptionsSchema, true},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment