Add benchmark for StructExcept

pull/161/head
joeybloggs 9 years ago
parent 883731a774
commit 7757a227ed
  1. 32
      benchmarks_test.go

@ -153,6 +153,38 @@ func BenchmarkStructPartialFailure(b *testing.B) {
} }
} }
func BenchmarkStructExceptSuccess(b *testing.B) {
type Test struct {
Name string `validate:"required"`
NickName string `validate:"required"`
}
test := &Test{
Name: "Joey Bloggs",
}
for n := 0; n < b.N; n++ {
validate.StructPartial(test, "Nickname")
}
}
func BenchmarkStructExceptFailure(b *testing.B) {
type Test struct {
Name string `validate:"required"`
NickName string `validate:"required"`
}
test := &Test{
Name: "Joey Bloggs",
}
for n := 0; n < b.N; n++ {
validate.StructPartial(test, "Name")
}
}
func BenchmarkStructSimpleCrossFieldSuccess(b *testing.B) { func BenchmarkStructSimpleCrossFieldSuccess(b *testing.B) {
type Test struct { type Test struct {

Loading…
Cancel
Save