]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/spawn.t
httpd/async: set O_NONBLOCK correctly
[public-inbox.git] / t / spawn.t
index 0eed79bbbb5802343717a4590ab2e79406c9ccd6..6f811ec163df75fab559a2c119b723daad23f27f 100644 (file)
--- a/t/spawn.t
+++ b/t/spawn.t
@@ -77,6 +77,11 @@ EOF
 {
        my $fh = popen_rd([qw(printf foo\nbar)]);
        ok(fileno($fh) >= 0, 'tied fileno works');
+       my $tfh = (tied *$fh)->{fh};
+       is($tfh->blocking(0), 1, '->blocking was true');
+       is($tfh->blocking, 0, '->blocking is false');
+       is($tfh->blocking(1), 0, '->blocking was true');
+       is($tfh->blocking, 1, '->blocking is true');
        my @line = <$fh>;
        is_deeply(\@line, [ "foo\n", 'bar' ], 'wantarray works on readline');
 }