feat: validate more special chars
This commit is contained in:
@@ -156,6 +156,36 @@ func TestValidateString(t *testing.T) {
|
||||
expected: "",
|
||||
ok: false,
|
||||
},
|
||||
{
|
||||
name: "Valid consecutive special chars",
|
||||
input: "Valid_(special)_Chars",
|
||||
expected: "Valid_(special)_Chars",
|
||||
ok: true,
|
||||
},
|
||||
{
|
||||
name: "Too many consecutive special chars",
|
||||
input: "Too_Many_(special[_]Chars",
|
||||
expected: "",
|
||||
ok: false,
|
||||
},
|
||||
{
|
||||
name: "Special char at the beginning",
|
||||
input: "$pecialString",
|
||||
expected: "",
|
||||
ok: false,
|
||||
},
|
||||
{
|
||||
name: "Special char at the end",
|
||||
input: "SpecialString_",
|
||||
expected: "",
|
||||
ok: false,
|
||||
},
|
||||
{
|
||||
name: "All valid special chars",
|
||||
input: "A@#b$%c^*d-_e=+f~(g)[h]{i}j",
|
||||
expected: "A@#b$%c^*d-_e=+f~(g)[h]{i}j",
|
||||
ok: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user