代码拉取完成,页面将自动刷新
// This file is part of the guanguans/id-validator.
// (c) guanguans <ityaozm@gmail.com>
// This source file is subject to the MIT license that is bundled.
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) {
for i := 0; i < 100; i++ {
if got1 := IsValid(FakeId(), false); !got1 {
t.Errorf("`got1` must be true.: %v", got1)
}
if got2 := IsValid(FakeRequireId(true, "江苏省", "200001", 1), false); !got2 {
t.Errorf("`got2` must be true.: %v", got2)
}
if _, e1 := GetInfo(FakeId(), false); e1 != nil {
t.Errorf("`e1` must be nil.: %v", e1)
}
if _, e2 := GetInfo(FakeRequireId(true, "江苏省", "200001", 1), false); e2 != nil {
t.Errorf("`e2` must be nil.: %v", e2)
}
// id, e3 := UpgradeId(FakeRequireId(false, "", "", 0))
id, e3 := UpgradeId("610104620927690")
if e3 != nil {
t.Errorf("`e3` must be nil.: %v", e3)
}
if l := len(id); l != 18 {
t.Errorf("`id` of length must be 18.: %d", l)
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。