Skip to content

Commit

Permalink
Add benchmark for StructExcept
Browse files Browse the repository at this point in the history
  • Loading branch information
joeybloggs authored and joeybloggs committed Aug 19, 2015
1 parent 883731a commit 7757a22
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

type Test struct {
Expand Down

0 comments on commit 7757a22

Please sign in to comment.