38 lines
516 B
Go
38 lines
516 B
Go
package refutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func TestIsValueEqual(t *testing.T) {
|
|
for _, v := range [][]interface{}{
|
|
[]interface{}{
|
|
false,
|
|
1,
|
|
"1.0",
|
|
},
|
|
[]interface{}{
|
|
true,
|
|
"1",
|
|
utils.String2Pointer("1"),
|
|
},
|
|
[]interface{}{
|
|
true,
|
|
"1",
|
|
1,
|
|
},
|
|
[]interface{}{
|
|
true,
|
|
int64(100),
|
|
int(100),
|
|
},
|
|
} {
|
|
result := IsValueEqual(v[1], v[2])
|
|
if result != v[0].(bool) {
|
|
t.Fatalf("%v,%v, desired:%v, get:%v", v[1], v[2], v[0], result)
|
|
}
|
|
}
|
|
}
|