From 8bc46b23dcf95a9bb6f9c214613d2fad44a4c82a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 19 Mar 2008 16:19:20 +0000 Subject: [PATCH] - Rename "Block Test" directive to "Blocked URL". - In get_final_results(), save the action parameter properly. - In tokenize(), reverse HTML-encoding for ampersands. - Allow tildes in check_for_forbidden_characters(). --- tools/privoxy-regression-test.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 277d4333..7bf82c13 100755 --- a/tools/privoxy-regression-test.pl +++ b/tools/privoxy-regression-test.pl @@ -7,7 +7,7 @@ # A regression test "framework" for Privoxy. For documentation see: # perldoc privoxy-regression-test.pl # -# $Id: privoxy-regression-test.pl,v 1.115 2008/03/18 22:07:34 fk Exp $ +# $Id: privoxy-regression-test.pl,v 1.118 2008/03/19 16:15:45 fk Exp $ # # Wish list: # @@ -144,7 +144,7 @@ sub parse_tag ($) { sub check_for_forbidden_characters ($) { my $tag = shift; # XXX: also used to check values though. - my $allowed = '[-=\dA-Za-z{}:.\/();\s,+@"_%\?&]'; + my $allowed = '[-=\dA-Za-z~{}:.\/();\s,+@"_%\?&]'; unless ($tag =~ m/^$allowed*$/) { my $forbidden = $tag; @@ -191,7 +191,7 @@ sub token_starts_new_test ($) { my $token = shift; my @new_test_directives = - ('set header', 'fetch test', 'trusted cgi request', 'request header', 'method test', 'block test'); + ('set header', 'fetch test', 'trusted cgi request', 'request header', 'method test', 'blocked url'); foreach my $new_test_directive (@new_test_directives) { return 1 if $new_test_directive eq $token; @@ -211,6 +211,7 @@ sub tokenize ($) { # Reverse HTML-encoding # XXX: Seriously imcomplete. s@"@"@g; + s@&@&@g; # Tokenize if (/^\#\s*([^=:]*?)\s*[=]\s*(.*?)\s*$/) { @@ -272,7 +273,7 @@ sub enlist_new_test ($$$$$$) { $$regression_tests[$si][$ri]{'expected-status-code'} = 200; $$regression_tests[$si][$ri]{'level'} = METHOD_TEST; - } elsif ($token eq 'block test') { + } elsif ($token eq 'blocked url') { l(LL_FILE_LOADING, "URL to block-test: " . $value); $$regression_tests[$si][$ri]{'type'} = BLOCK_TEST; @@ -667,7 +668,7 @@ sub get_final_results ($) { if (m@
([-+])([^>]*)( \{.*\})@) { my $action = $1.$2; my $value = $3; - $final_results{$action}{$value}; + $final_results{$action} = $value; } } -- 2.39.2