SkuName.Upc改为*string(以支持null及添加唯一索引)
This commit is contained in:
37
globals/refutil/refutil_test.go
Normal file
37
globals/refutil/refutil_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user