| From 7ffe93cabb181f39ad5091c31ab9f61bd940a55f Mon Sep 17 00:00:00 2001 |
| From: Anton Yuzhaninov <citrin+github@citrin.ru> |
| Date: Wed, 5 Apr 2017 19:06:42 +0300 |
| Subject: [PATCH] Fix perl warnings in tests |
| |
| * tests/FTPServer.pm: Escape '{' in RE to fix warnings |
| * tests/FTPTest.pm: Likewise |
| * tests/HTTPServer.pm: Likewise |
| * tests/HTTPTest.pm: Likewise |
| * tests/Test-proxied-https-auth-keepalive.px: Likewise |
| * tests/Test-proxied-https-auth.px: Likewise |
| Escape '{' in RE to fix warnings: |
| Unescaped left brace in regex is deprecated, passed through in regex; |
| marked by <-- HERE in m/{{ <-- HERE port}}/ |
| --- |
| tests/FTPServer.pm | 2 +- |
| tests/FTPTest.pm | 2 +- |
| tests/HTTPServer.pm | 2 +- |
| tests/HTTPTest.pm | 2 +- |
| tests/Test-proxied-https-auth-keepalive.px | 2 +- |
| tests/Test-proxied-https-auth.px | 2 +- |
| 6 files changed, 6 insertions(+), 6 deletions(-) |
| |
| diff --git a/tests/FTPServer.pm b/tests/FTPServer.pm |
| index a5185d66..cac80942 100644 |
| --- a/tests/FTPServer.pm |
| +++ b/tests/FTPServer.pm |
| @@ -589,7 +589,7 @@ sub new |
| foreach my $file (keys %{$self->{_input}}) |
| { |
| my $ref = \$self->{_input}{$file}{content}; |
| - $$ref =~ s/{{port}}/$self->sockport/eg; |
| + $$ref =~ s/\Q{{port}}/$self->sockport/eg; |
| } |
| |
| return $self; |
| diff --git a/tests/FTPTest.pm b/tests/FTPTest.pm |
| index 50385ad0..0a1c768c 100644 |
| --- a/tests/FTPTest.pm |
| +++ b/tests/FTPTest.pm |
| @@ -53,7 +53,7 @@ sub _substitute_port |
| { |
| my $self = shift; |
| my $ret = shift; |
| - $ret =~ s/{{port}}/$self->{_server}->sockport/eg; |
| + $ret =~ s/\Q{{port}}/$self->{_server}->sockport/eg; |
| return $ret; |
| } |
| |
| diff --git a/tests/HTTPServer.pm b/tests/HTTPServer.pm |
| index dd8ec043..78609f65 100644 |
| --- a/tests/HTTPServer.pm |
| +++ b/tests/HTTPServer.pm |
| @@ -310,7 +310,7 @@ sub _substitute_port |
| { |
| my $self = shift; |
| my $ret = shift; |
| - $ret =~ s/{{port}}/$self->sockport/eg; |
| + $ret =~ s/\Q{{port}}/$self->sockport/eg; |
| return $ret; |
| } |
| |
| diff --git a/tests/HTTPTest.pm b/tests/HTTPTest.pm |
| index 00f079f8..6225c7f1 100644 |
| --- a/tests/HTTPTest.pm |
| +++ b/tests/HTTPTest.pm |
| @@ -47,7 +47,7 @@ sub _substitute_port |
| { |
| my $self = shift; |
| my $ret = shift; |
| - $ret =~ s/{{port}}/$self->{_server}->sockport/eg; |
| + $ret =~ s/\Q{{port}}/$self->{_server}->sockport/eg; |
| return $ret; |
| } |
| |
| diff --git a/tests/Test-proxied-https-auth-keepalive.px b/tests/Test-proxied-https-auth-keepalive.px |
| index 049bebec..2a18ccfd 100755 |
| --- a/tests/Test-proxied-https-auth-keepalive.px |
| +++ b/tests/Test-proxied-https-auth-keepalive.px |
| @@ -153,7 +153,7 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee" |
| . " --password=Dodgson -e https_proxy=localhost:{{port}}" |
| . " --no-check-certificate" |
| . " https://no.such.domain/needs-auth.txt"; |
| -$cmdline =~ s/{{port}}/$SOCKET->sockport()/e; |
| +$cmdline =~ s/\Q{{port}}/$SOCKET->sockport()/e; |
| |
| if (defined $srcdir) { |
| $VALGRIND_SUPP_FILE = $srcdir . '/valgrind-suppressions-ssl'; |
| diff --git a/tests/Test-proxied-https-auth.px b/tests/Test-proxied-https-auth.px |
| index ce4e736c..878114e7 100755 |
| --- a/tests/Test-proxied-https-auth.px |
| +++ b/tests/Test-proxied-https-auth.px |
| @@ -152,7 +152,7 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee" |
| . " --password=Dodgson -e https_proxy=localhost:{{port}}" |
| . " --no-check-certificate" |
| . " https://no.such.domain/needs-auth.txt"; |
| -$cmdline =~ s/{{port}}/$SOCKET->sockport()/e; |
| +$cmdline =~ s/\Q{{port}}/$SOCKET->sockport()/e; |
| |
| if (defined $srcdir) { |
| $VALGRIND_SUPP_FILE = $srcdir . '/valgrind-suppressions-ssl'; |
| -- |
| 2.14.3 |
| |