1 Star 0 Fork 1

liuxuezhan / id-validator

forked from guanguans / id-validator 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
feature_test.go 863 Bytes
一键复制 编辑 原始数据 按行查看 历史
guanguans 提交于 2021-01-12 16:09 . Update github config files
package idvalidator
import "testing"
// go test -v -cover -coverprofile=cover.out
// go tool cover -func=cover.out
// go tool cover -html=cover.out
func TestFeature(t *testing.T) {
// isValid1 := IsValid(FakeId())
// if !isValid1 {
// t.Errorf("`isValid1` must be true.")
// }
isValid2 := IsValid(FakeRequireId(true, "江苏省", "200001", 1))
if !isValid2 {
t.Errorf("`isValid2` must be true.")
}
_, err1 := GetInfo(FakeRequireId(true, "江苏省", "200001", 1))
if err1 != nil {
t.Errorf("`err1` must be nil.")
}
_, err2 := GetInfo(FakeRequireId(true, "江苏省", "200001", 1))
if err2 != nil {
t.Errorf("`err2` must be nil.")
}
upgradedId, err3 := UpgradeId("610104620927690")
if err3 != nil {
t.Errorf("`err3` must be nil.")
}
if len(upgradedId) != 18 {
t.Errorf("`upgradedId` length must be 18.:%d", len(upgradedId))
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/liuxuezhan/id-validator.git
git@gitee.com:liuxuezhan/id-validator.git
liuxuezhan
id-validator
id-validator
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891