mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-28 21:07:39 +00:00
diceware: add default wordlist to exercise tests
This commit is contained in:
parent
5395b4853b
commit
ab8f6a43ee
7776
passgen/diceware/src/main/resources/diceware_wordlist.txt
Normal file
7776
passgen/diceware/src/main/resources/diceware_wordlist.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package dev.msfjarvis.aps.passgen.diceware
|
package dev.msfjarvis.aps.passgen.diceware
|
||||||
|
|
||||||
|
import java.io.InputStream
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
@ -17,4 +18,21 @@ class WordListParserTest {
|
|||||||
assertEquals("abcde", parsedMap[11111])
|
assertEquals("abcde", parsedMap[11111])
|
||||||
assertEquals("fghij", parsedMap[22222])
|
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")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user