+GenFakeUPC

This commit is contained in:
gazebo
2019-12-13 15:18:06 +08:00
parent a6925cfb70
commit d20d98816e
4 changed files with 43 additions and 28 deletions

View File

@@ -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])
}
}
}