feat: validate more special chars

This commit is contained in:
Ilia Denisov
2026-02-17 19:36:43 +02:00
parent 1379241967
commit d42cee9df1
3 changed files with 51 additions and 18 deletions
+30
View File
@@ -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 {