mchess-server/utils/passphrase_test.go

22 lines
363 B
Go

package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_onlyUniqueWords(t *testing.T) {
wordsDistribution := make(map[string]int)
for _, word := range CleanWords {
wordsDistribution[word] += 1
}
for _, v := range wordsDistribution {
assert.Equal(t, 1, v)
}
assert.Equal(t, numberOfCleanWords, len(wordsDistribution))
}