1
0
mirror of https://github.com/taigrr/pastebin synced 2026-04-17 00:44:58 -07:00

fix: improve error handling, remove any type, add edge case protections

This commit is contained in:
2026-03-09 06:01:08 +00:00
parent 21bc47697b
commit 4038172e78
3 changed files with 31 additions and 8 deletions

View File

@@ -23,6 +23,11 @@ func TestRandomStringUniqueness(t *testing.T) {
}
}
func TestRandomStringZeroLength(t *testing.T) {
assert.Equal(t, "", RandomString(0))
assert.Equal(t, "", RandomString(-1))
}
func TestRandomStringURLSafe(t *testing.T) {
for range 50 {
result := RandomString(32)