diff options
Diffstat (limited to 'passgen/diceware/src/test')
-rw-r--r-- | passgen/diceware/src/test/kotlin/dev/msfjarvis/aps/passgen/diceware/WordListParserTest.kt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/passgen/diceware/src/test/kotlin/dev/msfjarvis/aps/passgen/diceware/WordListParserTest.kt b/passgen/diceware/src/test/kotlin/dev/msfjarvis/aps/passgen/diceware/WordListParserTest.kt index e60db38c..a1633c69 100644 --- a/passgen/diceware/src/test/kotlin/dev/msfjarvis/aps/passgen/diceware/WordListParserTest.kt +++ b/passgen/diceware/src/test/kotlin/dev/msfjarvis/aps/passgen/diceware/WordListParserTest.kt @@ -5,6 +5,7 @@ package dev.msfjarvis.aps.passgen.diceware +import java.io.InputStream import kotlin.test.Test import kotlin.test.assertEquals @@ -17,4 +18,21 @@ class WordListParserTest { assertEquals("abcde", parsedMap[11111]) assertEquals("fghij", parsedMap[22222]) } + + @Test + fun parseDefaultWordList() { + val wordlist = getDefaultWordList() + val parsedMap = WordListParser.parse(wordlist) + assertEquals(7776, parsedMap.size) + assertEquals("zoom", parsedMap[66666]) + assertEquals("salute", parsedMap[52621]) + } + + companion object { + fun getDefaultWordList(): InputStream { + return requireNotNull( + this::class.java.classLoader.getResourceAsStream("diceware_wordlist.txt") + ) + } + } } |