summaryrefslogtreecommitdiff
path: root/tests/t0010-generate-tests.sh
blob: cadb76fcb5a27be7ed569bc288d3f99e75c4b70f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

test_description='Test generate'
cd "$(dirname "$0")"
. ./setup.sh

test_expect_success 'Test "generate" command' '
	"$PASS" init $KEY1 &&
	"$PASS" generate cred 19 &&
	[[ $("$PASS" show cred | wc -m) -eq 20 ]]
'

test_expect_success 'Test replacement of first line' '
	"$PASS" insert -m cred2 <<<"$(printf "this is a big\\npassword\\nwith\\nmany\\nlines\\nin it bla bla")" &&
	PATH="$TEST_HOME:$PATH" FAKE_PWGEN_PASSWORD="This is a fake password" "$PASS" generate -i cred2 88 &&
	[[ $("$PASS" show cred2) == "$(printf "This is a fake password\\npassword\\nwith\\nmany\\nlines\\nin it bla bla")" ]]
'

test_done
/a>René 'Necoro' Neumann1-2/+24 2010-02-25Small config commit functionRené 'Necoro' Neumann1-0/+35 2010-02-25pass --debug to equery to make it shut up -- also for the 'masked' callRené 'Necoro' Neumann1-1/+1 2010-02-23pass --debug to equery to make it shut upRené 'Necoro' Neumann1-1/+1 2010-02-20Update popups value to the new syntax in vimperator 2.2René 'Necoro' Neumann1-1/+1 2009-12-18Added vim mapping for haskellRené 'Necoro' Neumann1-0/+2