Refactored unit tests
This commit is contained in:
parent
aaccc14e76
commit
4980788afc
20 changed files with 876 additions and 769 deletions
25
how-to-create-encrypted-paper-backup/tests/shamir-2-of-3.exp
Normal file
25
how-to-create-encrypted-paper-backup/tests/shamir-2-of-3.exp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/expect
|
||||
|
||||
source ./test.exp
|
||||
|
||||
set passphrase "asdasd"
|
||||
set secret "foo\nbar"
|
||||
|
||||
test_label "Should backup secret using 2-of-3 Shamir Secret Sharing"
|
||||
|
||||
source ./tests/helpers/shamir-2-of-3-backup.exp
|
||||
|
||||
test_ok
|
||||
|
||||
test_label "Should restore secret using 2-of-3 Shamir Secret Sharing"
|
||||
|
||||
source ./tests/helpers/shamir-2-of-3-restore.exp
|
||||
|
||||
regsub -all {(\e\(B)?\e\[[0-9]*?m} $restored_secret {} restored_secret
|
||||
regsub -all {\r} $restored_secret {} restored_secret
|
||||
|
||||
if { "$restored_secret" != "$secret" } {
|
||||
test_failed
|
||||
} else {
|
||||
test_ok
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue