summaryrefslogtreecommitdiff
path: root/src/t
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-01 08:59:47 +0200
committerRaphaël Hertzog <hertzog@debian.org>2010-08-01 08:59:47 +0200
commit9036687a8cbd87ce319df56dd362bb2adae96fc4 (patch)
tree2880818a8983d6553f619ed2d59713eeb82e4503 /src/t
parent4aed1d728958584769d469540e9ae6103e13d424 (diff)
downloaddpkg-9036687a8cbd87ce319df56dd362bb2adae96fc4.tar.gz
Fix dpkg-divert test suite to cope with + in the build directory name
The directory name was not properly escaped in regular expressions and lead to test failures when it contained + or other characters with special meanings in regular expressions. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Diffstat (limited to 'src/t')
-rw-r--r--src/t/100_dpkg_divert.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/t/100_dpkg_divert.t b/src/t/100_dpkg_divert.t
index 8d7b58d67..4f0fb4199 100644
--- a/src/t/100_dpkg_divert.t
+++ b/src/t/100_dpkg_divert.t
@@ -236,7 +236,7 @@ install_diversions('');
system("touch $testdir/foo");
call_divert(['--rename', '--add', "$testdir/foo"],
- expect_stdout_like => qr,Adding.*local.*diversion.*$testdir/foo.*$testdir/foo.distrib,,
+ expect_stdout_like => qr,Adding.*local.*diversion.*\Q$testdir\E/foo.*\Q$testdir\E/foo.distrib,,
expect_stderr => '');
ok(-e "$testdir/foo.distrib", "foo diverted");
ok(!-e "$testdir/foo", "foo diverted");
@@ -250,7 +250,7 @@ install_diversions('');
system("touch $testdir/foo");
call_divert(['--add', "$testdir/foo"],
- expect_stdout_like => qr,Adding.*local.*diversion.*$testdir/foo.*$testdir/foo.distrib,,
+ expect_stdout_like => qr,Adding.*local.*diversion.*\Q$testdir\E/foo.*\Q$testdir\E/foo.distrib,,
expect_stderr => '');
ok(!-e "$testdir/foo.distrib", "foo diverted");
ok(-e "$testdir/foo", "foo diverted");
@@ -408,7 +408,7 @@ call_divert(["--package", "baz", "--divert", "$testdir/foo.my", "--remove", "$te
expect_failure => 1, expect_stderr_like =>qr/mismatch on (package|divert-to)/);
call_divert(["--divert", "$testdir/foo.distrib", "--remove", "$testdir/foo"],
- expect_stdout_like => qr,Removing.*$testdir/foo,);
+ expect_stdout_like => qr,Removing.*\Q$testdir\E/foo,);
diversions_eq(<<EOF);
$testdir/bar
$testdir/bar.distrib
@@ -429,7 +429,7 @@ call_divert(["$testdir/bar"]);
call_divert(["$testdir/baz"]);
call_divert(["--remove", "$testdir/bar"],
- expect_stdout_like => qr,Removing.*$testdir/bar,);
+ expect_stdout_like => qr,Removing.*\Q$testdir\E/bar,);
diversions_eq(<<EOF);
$testdir/foo
$testdir/foo.distrib
@@ -469,7 +469,7 @@ system("touch $testdir/foo");
call_divert(["--rename", "$testdir/foo"]);
call_divert(["--test", "--rename", "--remove", "$testdir/foo"],
- expect_stdout_like => qr,Removing.*$testdir/foo,, expect_stderr => '');
+ expect_stdout_like => qr,Removing.*\Q$testdir\E/foo,, expect_stderr => '');
ok(-e "$testdir/foo.distrib");
ok(!-e "$testdir/foo");
diversions_eq($diversions_added_foo_local);