aboutsummaryrefslogtreecommitdiff
path: root/t/relativity.t
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2014-10-10 21:17:39 -0400
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2014-10-10 21:17:39 -0400
commitdc872e42c8649f5b3fd59861e5c56c89d9fc1cbb (patch)
treec12de4b6c551522e3a6a048ad80947656678d7a7 /t/relativity.t
parentcd9297322a9e909b908320aa8824a7b524396e2f (diff)
downloadikiwiki-dc872e42c8649f5b3fd59861e5c56c89d9fc1cbb.tar
ikiwiki-dc872e42c8649f5b3fd59861e5c56c89d9fc1cbb.tar.gz
Extract check_cgi_mode_bits(). No change intended.
Diffstat (limited to 't/relativity.t')
-rwxr-xr-xt/relativity.t77
1 files changed, 17 insertions, 60 deletions
diff --git a/t/relativity.t b/t/relativity.t
index c562dccb7..5922ec9fa 100755
--- a/t/relativity.t
+++ b/t/relativity.t
@@ -92,6 +92,13 @@ sub thoroughly_rebuild {
ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
}
+sub check_cgi_mode_bits {
+ my (undef, undef, $mode, undef, undef,
+ undef, undef, undef, undef, undef,
+ undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
+ is($mode & 07777, 0754);
+}
+
#######################################################################
# site 1: a perfectly ordinary ikiwiki
@@ -101,12 +108,7 @@ write_setup_file(
cgiurl => "http://example.com/cgi-bin/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-my (undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -184,12 +186,7 @@ write_setup_file(
cgiurl => "http://example.com/cgi-bin/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -270,12 +267,7 @@ write_setup_file(
cgiurl => "http://cgi.example.com/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -343,12 +335,7 @@ write_setup_file(
cgiurl => "http://cgi.example.com/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -420,12 +407,7 @@ write_setup_file(
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -513,12 +495,7 @@ write_setup_file(
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -603,12 +580,7 @@ write_setup_file(
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -700,12 +672,7 @@ write_setup_file(
w3mmode => 1,
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -737,12 +704,7 @@ write_setup_file(
w3mmode => 1,
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");
@@ -777,12 +739,7 @@ write_setup_file(
reverse_proxy => 1,
);
thoroughly_rebuild();
-
-# CGI wrapper should be exactly the requested mode
-(undef, undef, $mode, undef, undef,
- undef, undef, undef, undef, undef,
- undef, undef, undef) = stat("t/tmp/ikiwiki.cgi");
-is($mode & 07777, 0754);
+check_cgi_mode_bits();
ok(-e "t/tmp/out/a/b/c/index.html");
$content = readfile("t/tmp/out/a/b/c/index.html");