+GenFakeUPC
This commit is contained in:
@@ -284,3 +284,20 @@ func TestGetOneEmailFromStr(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenFakeUPC(t *testing.T) {
|
||||
for _, v := range [][]string{
|
||||
[]string{
|
||||
"6666000000123",
|
||||
"123",
|
||||
},
|
||||
[]string{
|
||||
"6666007654321",
|
||||
"7654321",
|
||||
},
|
||||
} {
|
||||
if str := GenFakeUPC(int(utils.Str2Int64(v[1]))); str != v[0] {
|
||||
t.Errorf("%s failed, result:%s, expect:%s", v[1], str, v[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user