Remove more words and remove duplicates
This commit is contained in:
parent
3b77a01dad
commit
b2ebf2cc5d
1533
utils/clean-words.go
1533
utils/clean-words.go
File diff suppressed because it is too large
Load Diff
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user