Debian Codegraph @

debian/tests/create-passphrase

raw
1 #!/bin/sh
2
3 # This test generates a passphrase using diceware and makes sure that
4 # the requested number of words are returned.
5
6 main() {
7 output=$( diceware -d " " -n 8 )
8
9 length=$( echo ${output} | wc -c )
10 [ ${length} -ge 15 ]
11
12 spacecount=$( echo ${output} | tr -C -d " " | wc -c )
13 [ ${spacecount} -eq 7 ]
14
15 doublespace=$( echo ${output} | grep " " )
16 [ -z "${doublespace}" ]
17 }
18
19 main