Files
h/unique-chars/main_test.go
2024-05-08 18:55:56 +03:00

45 lines
637 B
Go

package uniqueschars
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUnique(t *testing.T) {
cases := []struct {
Name string
input string
expected bool
}{
{
"eng alphabet",
"abcdefghijklmnopqrstuvwxyz",
true,
},
{
"eng mixed case",
"aAbBfF",
false,
},
{
"cyrillic alphabet",
"абвгдеёжзийклмнопрстуфхцчшщъыьэюя",
true,
},
{
"cyrillic case mixed",
"аАбБвВ",
false,
},
}
for _, tc := range cases {
tc := tc
t.Run(tc.Name, func(t *testing.T) {
assert.Equal(t, tc.expected, Unique(tc.input))
})
}
}