bbgo_origin/util/math_test.go
2020-07-11 15:18:31 +08:00

37 lines
502 B
Go

package util
import "testing"
func TestNotZero(t *testing.T) {
type args struct {
v float64
}
tests := []struct {
name string
args args
want bool
}{
{
name: "0",
args: args{
v: 0,
},
want: false,
},
{
name: "0.00001",
args: args{
v: 0.00001,
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := NotZero(tt.args.v); got != tt.want {
t.Errorf("NotZero() = %v, want %v", got, tt.want)
}
})
}
}