diff options
Diffstat (limited to 'generator/generator_test.go')
-rw-r--r-- | generator/generator_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/generator/generator_test.go b/generator/generator_test.go new file mode 100644 index 0000000..4cda593 --- /dev/null +++ b/generator/generator_test.go @@ -0,0 +1,15 @@ +package generator + +import "testing" + +func TestRandomWords(t *testing.T) { + words, err := RandomWords("/usr/share/dict/words", 4) + + if err != nil { + t.Errorf("%s", err) + } + + if len(words) != 4 { + t.Errorf("RandomWords does not return the correct number of words") + } +} |