Skip to content

Commit

Permalink
fix(test): Add invalid ID with special characters
Browse files Browse the repository at this point in the history
- Add an invalid ID with special characters to the test cases
- Ensure the ID is correctly identified as invalid
- Remove the redundant test case for an invalid ID
  • Loading branch information
guanguans committed Jul 4, 2023
1 parent 3fe5dba commit 8163c06
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions id_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestIsValid(t *testing.T) {
"440308199901101513", // 验证码不合法
"610104620932690", // 出生日期码不合法
"11010119900307867X", // 校验位不合法
"TES12345678901 j", // 特殊字符格式不合法
}
for _, id := range errIds {
if IsValid(id, false) {
Expand Down Expand Up @@ -59,13 +60,6 @@ func TestIsValid(t *testing.T) {
}
}

func TestInvalidId(t *testing.T) {
id := "TES12345678901 j"
if IsValid(id, false) {
t.Errorf("ID must be invalid.: %s", id)
}
}

func TestGetInfo(t *testing.T) {
_, e1 := GetInfo("500154199301135886", false)
if e1 != nil {
Expand Down

0 comments on commit 8163c06

Please sign in to comment.