2024-04-30 21:55:27 +00:00
|
|
|
package utils
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2024-05-02 10:47:18 +00:00
|
|
|
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)
|
2024-04-30 21:55:27 +00:00
|
|
|
}
|
2024-05-02 10:47:18 +00:00
|
|
|
|
|
|
|
assert.Equal(t, numberOfCleanWords, len(wordsDistribution))
|
2024-04-30 21:55:27 +00:00
|
|
|
}
|