about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-10 10:01:41 +0000
committerEric Wong <mwrap-perl@80x24.org>2022-12-10 20:45:48 +0000
commit9a390ea020c0f923734da79b3c39761cf929cc9c (patch)
treefc6a3464e257d1ee28ebb233acd14191f149f27e
parent730f10e5e652fca4f4d142af8c0bb5c99053a0ae (diff)
downloadmwrap-9a390ea020c0f923734da79b3c39761cf929cc9c.tar.gz
I'm terrible at this stuff :<
-rw-r--r--t/httpd-unit.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/httpd-unit.t b/t/httpd-unit.t
index 049d5fc..768b2db 100644
--- a/t/httpd-unit.t
+++ b/t/httpd-unit.t
@@ -95,4 +95,17 @@ open STDERR, '>', $err;
 isnt(system(@vg, $exe, "socket_dir:$s"), 0, "listen dir on socket fails");
 like($end_err->(), qr/stat.*directory/, 'stat failure shown');
 
+# check for fencepost errors
+my $len;
+if ($^O eq 'linux') { $len = 108 }
+elsif ($^O eq 'freebsd') { $len = 104 }
+SKIP: {
+        skip "length unknown on $^O OS", 2 if !defined($len);
+        $len -= length("$tmp");
+        $len -= length("\0//$TEST_PID.sock");
+        my $max = "$tmp/".('x'x$len);
+        is(system(@vg, $exe, "socket_dir:$max"), 0, "listen dir on max");
+        isnt(system(@vg, $exe, "socket_dir:$max+"), 0, "listen dir too long");
+}
+
 done_testing;