summaryrefslogtreecommitdiff
path: root/scripts/t/500_Dpkg_Path.t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-12-31 21:43:39 +0100
committerGuillem Jover <guillem@debian.org>2013-05-04 19:03:13 +0200
commit6a73e3078b01a71d4a6ea90c85da16523ed56f1d (patch)
tree4cc7a210e7e851395f7ba4989e3aac4aa9d32710 /scripts/t/500_Dpkg_Path.t
parent62bc788a45e4a641c28ca9c8c5b9bb08f29faed8 (diff)
downloaddpkg-6a73e3078b01a71d4a6ea90c85da16523ed56f1d.tar.gz
Do not use double-quotes on strings that do not need interpolation
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
Diffstat (limited to 'scripts/t/500_Dpkg_Path.t')
-rw-r--r--scripts/t/500_Dpkg_Path.t36
1 files changed, 18 insertions, 18 deletions
diff --git a/scripts/t/500_Dpkg_Path.t b/scripts/t/500_Dpkg_Path.t
index dd79ea2f7..930c8cdc6 100644
--- a/scripts/t/500_Dpkg_Path.t
+++ b/scripts/t/500_Dpkg_Path.t
@@ -33,28 +33,28 @@ mkdir "$tmpdir/debian";
mkdir "$tmpdir/debian/a";
mkdir "$tmpdir/debian/a/b";
mkdir "$tmpdir/debian/a/b/c";
-symlink "a/b/c", "$tmpdir/cbis";
-symlink "/this/does/not/exist", "$tmpdir/tmp";
-symlink ".", "$tmpdir/here";
+symlink 'a/b/c', "$tmpdir/cbis";
+symlink '/this/does/not/exist', "$tmpdir/tmp";
+symlink '.', "$tmpdir/here";
-is(canonpath("$tmpdir/./a///b/c"), "$tmpdir/a/b/c", "canonpath basic test");
-is(canonpath("$tmpdir/a/b/../../a/b/c"), "$tmpdir/a/b/c", "canonpath and ..");
-is(canonpath("$tmpdir/a/b/c/../../"), "$tmpdir/a", "canonpath .. at end");
-is(canonpath("$tmpdir/cbis/../"), "$tmpdir/cbis/..", "canonpath .. after symlink");
+is(canonpath("$tmpdir/./a///b/c"), "$tmpdir/a/b/c", 'canonpath basic test');
+is(canonpath("$tmpdir/a/b/../../a/b/c"), "$tmpdir/a/b/c", 'canonpath and ..');
+is(canonpath("$tmpdir/a/b/c/../../"), "$tmpdir/a", 'canonpath .. at end');
+is(canonpath("$tmpdir/cbis/../"), "$tmpdir/cbis/..", 'canonpath .. after symlink');
-is(resolve_symlink("$tmpdir/here/cbis"), "$tmpdir/here/a/b/c", "resolve_symlink");
-is(resolve_symlink("$tmpdir/tmp"), "/this/does/not/exist", "resolve_symlink absolute");
-is(resolve_symlink("$tmpdir/here"), $tmpdir, "resolve_symlink .");
+is(resolve_symlink("$tmpdir/here/cbis"), "$tmpdir/here/a/b/c", 'resolve_symlink');
+is(resolve_symlink("$tmpdir/tmp"), '/this/does/not/exist', 'resolve_symlink absolute');
+is(resolve_symlink("$tmpdir/here"), $tmpdir, 'resolve_symlink .');
-ok(!check_files_are_the_same("$tmpdir/here", $tmpdir), "Symlink is not the same!");
-ok(check_files_are_the_same("$tmpdir/here/a", "$tmpdir/a"), "Same directory");
+ok(!check_files_are_the_same("$tmpdir/here", $tmpdir), 'Symlink is not the same!');
+ok(check_files_are_the_same("$tmpdir/here/a", "$tmpdir/a"), 'Same directory');
-is(get_pkg_root_dir("$tmpdir/a/b/c"), "$tmpdir/a", "get_pkg_root_dir");
-is(guess_pkg_root_dir("$tmpdir/a/b/c"), "$tmpdir/a", "guess_pkg_root_dir");
-is(relative_to_pkg_root("$tmpdir/a/b/c"), "b/c", "relative_to_pkg_root");
+is(get_pkg_root_dir("$tmpdir/a/b/c"), "$tmpdir/a", 'get_pkg_root_dir');
+is(guess_pkg_root_dir("$tmpdir/a/b/c"), "$tmpdir/a", 'guess_pkg_root_dir');
+is(relative_to_pkg_root("$tmpdir/a/b/c"), 'b/c', 'relative_to_pkg_root');
chdir($tmpdir);
-ok(!defined(get_pkg_root_dir("debian/a/b/c")), "get_pkg_root_dir undef");
-ok(!defined(relative_to_pkg_root("debian/a/b/c")), "relative_to_pkg_root");
-is(guess_pkg_root_dir("debian/a/b/c"), "debian/a", "guess_pkg_root_dir fallback");
+ok(!defined(get_pkg_root_dir('debian/a/b/c')), 'get_pkg_root_dir undef');
+ok(!defined(relative_to_pkg_root('debian/a/b/c')), 'relative_to_pkg_root');
+is(guess_pkg_root_dir('debian/a/b/c'), 'debian/a', 'guess_pkg_root_dir fallback');