diff options
Diffstat (limited to 'tests/foundational.bats')
-rw-r--r-- | tests/foundational.bats | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/foundational.bats b/tests/foundational.bats index 2d53b10..458b43f 100644 --- a/tests/foundational.bats +++ b/tests/foundational.bats @@ -49,6 +49,21 @@ created 2016-04-27 (main key ID 79205802880BC9D8)." [[ "$observed" == "$expected" ]] || diff -u <(echo -e "$observed") <(echo -e "$expected") } +@test "decode bastardized URL encoded string" { + local expected + mapfile -d '' expected <<- EOF + Please enter the passphrase to unlock the OpenPGP secret key: + "Matěj Cepl <mcepl@cepl.eu>" + 4096-bit RSA key, ID 77D15A36BD4211B2, + created 2016-04-27 (main key ID 79205802880BC9D8). + EOF + log_debug "expected: ${expected}" + log_debug "instr: ${instr}" + observed=$(basturldecode "${instr}") + log_debug "observed: ${observed}" + [[ "$observed" == "$expected" ]] || diff -u <(echo "$observed") <(printf "%s" "$expected") +} + @test "encode into RFC-3986 encoded string" { local expected |