mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-22 06:29:24 +08:00
version 1.0.1 (#8)
* anyutil test * fix:delete debug * unit test utils * unit test * strUtil unit test * fix;4, 6, 9, 11 Month determination error * fix:The last digit of ID number is x, and the weighted sum comparison condition is wrong * test * test * docs * fix:docs * idcard test * test unit * no message * docs update * 单元测试覆盖 --------- Co-authored-by: libin <libinjob@163.com> Co-authored-by: 李斌 <libin1-hj@huafang.com>
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package anyUtil
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestToBool(t *testing.T) {
|
||||
iPtr := 90
|
||||
|
||||
var tests = []struct {
|
||||
input interface{}
|
||||
want bool
|
||||
@@ -44,6 +48,8 @@ func TestToBool(t *testing.T) {
|
||||
{complex128(1 + 1i), true},
|
||||
{complex128(0 + 0i), false},
|
||||
{(*int)(nil), false},
|
||||
{&iPtr, true},
|
||||
{[]int{}, false},
|
||||
}
|
||||
for _, test := range tests {
|
||||
if got := AnyToBool(test.input); got != test.want {
|
||||
|
Reference in New Issue
Block a user