diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-05-06 17:23:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-05-06 17:36:48 +0200 |
commit | 276fb973ab8517f3ec888b4ee2114d982131293c (patch) | |
tree | 7be1efa981272e8f9733b484cd2b7ef98df70b6c /tests | |
parent | bd8cbd12331cf965c54645a5397e0acfe90b4c96 (diff) | |
download | pass-276fb973ab8517f3ec888b4ee2114d982131293c.tar.gz pass-276fb973ab8517f3ec888b4ee2114d982131293c.tar.bz2 pass-276fb973ab8517f3ec888b4ee2114d982131293c.zip |
generate: add --in-place option
Diffstat (limited to '')
-rwxr-xr-x | tests/pwgen | 2 | ||||
-rwxr-xr-x | tests/t0010-generate-tests.sh | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/pwgen b/tests/pwgen new file mode 100755 index 0000000..c83eec9 --- /dev/null +++ b/tests/pwgen @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo "${FAKE_PWGEN_PASSWORD:-Hello World}" diff --git a/tests/t0010-generate-tests.sh b/tests/t0010-generate-tests.sh index da5e41f..cadb76f 100755 --- a/tests/t0010-generate-tests.sh +++ b/tests/t0010-generate-tests.sh @@ -10,4 +10,10 @@ test_expect_success 'Test "generate" command' ' [[ $("$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 |