t0020-show-tests.sh (625B)
1 #!/usr/bin/env bash 2 3 test_description='Test show' 4 cd "$(dirname "$0")" 5 . ./setup.sh 6 7 test_expect_success 'Test "show" command' ' 8 "$PASS" init $KEY1 && 9 "$PASS" generate cred1 20 && 10 "$PASS" show cred1 11 ' 12 13 test_expect_success 'Test "show" command with spaces' ' 14 "$PASS" insert -e "I am a cred with lots of spaces"<<<"BLAH!!" && 15 [[ $("$PASS" show "I am a cred with lots of spaces") == "BLAH!!" ]] 16 ' 17 18 test_expect_success 'Test "show" command with unicode' ' 19 "$PASS" generate 🏠 && 20 "$PASS" show | grep -q '🏠' 21 ' 22 23 test_expect_success 'Test "show" of nonexistant password' ' 24 test_must_fail "$PASS" show cred2 25 ' 26 27 test_done