Remove more words and remove duplicates

This commit is contained in:
Marco 2024-05-02 12:47:18 +02:00
parent 3b77a01dad
commit b2ebf2cc5d
2 changed files with 28 additions and 1522 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,21 @@
package utils
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Passphrase(t *testing.T) {
for run := range 100 {
phrase := NewPassphrase()
fmt.Println(run, ": ", phrase)
assert.NotEmpty(t, phrase)
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))
}