mirror of https://github.com/spf13/cast.git
Add benchmark for ToBool
``` BenchmarkTooBool-4 500000 2781 ns/op 49 B/op 3 allocs/op ```
This commit is contained in:
parent
60e7a69a42
commit
7c3adfba29
|
@ -168,6 +168,14 @@ func TestToBool(t *testing.T) {
|
|||
assert.Equal(t, ToBool(-1), true)
|
||||
}
|
||||
|
||||
func BenchmarkTooBool(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
if !ToBool(true) {
|
||||
b.Fatal("ToBool returned false")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndirectPointers(t *testing.T) {
|
||||
x := 13
|
||||
y := &x
|
||||
|
|
Loading…
Reference in New Issue