diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-10-02 00:11:13 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-10-02 09:35:38 +0200 |
commit | 2dd53e82f1ec3de8a9ecc1261ca4d9077506a9bb (patch) | |
tree | df3a145f88537d2cc9e92776766bdd18feb0f2d9 /tests/runtests.pl | |
parent | 01327600e3a9f0bd23383eb21ad7dcdc84a0c249 (diff) | |
download | curl-2dd53e82f1ec3de8a9ecc1261ca4d9077506a9bb.tar.gz |
runtests: allow generating a binary sequence from hex
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-x | tests/runtests.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index 49b318dc7..325522182 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -3304,6 +3304,13 @@ sub subBase64 { # put the result into there $$thing =~ s/%%B64%%/$enc/; } + # hex decode + if($$thing =~ s/%hex\[(.*)\]hex%/%%HEX%%/i) { + # decode %NN characters + my $d = $1; + $d =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; + $$thing =~ s/%%HEX%%/$d/; + } } sub fixarray { |