diff options
-rw-r--r-- | t/httpd-unit.t | 13 |
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; |