SkuName.Upc改为*string(以支持null及添加唯一索引)

This commit is contained in:
gazebo
2019-12-23 16:15:14 +08:00
parent 23136cc467
commit 01247221c4
4 changed files with 78 additions and 26 deletions

View 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)
}
}
}