From: Vincent Pit Date: Mon, 27 Jul 2009 12:47:26 +0000 (+0200) Subject: Regression test for [perl #67912] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e41cc779424eaf419bea11fb7535e356b1113698;p=p5sagit%2Fp5-mst-13.2.git Regression test for [perl #67912] --- diff --git a/t/op/sysio.t b/t/op/sysio.t index dd63a15..b4c2954 100644 --- a/t/op/sysio.t +++ b/t/op/sysio.t @@ -1,6 +1,6 @@ #!./perl -print "1..42\n"; +print "1..44\n"; chdir('op') || chdir('t/op') || die "sysio.t: cannot look for myself: $!"; @INC = '../../lib'; @@ -179,8 +179,6 @@ if ($reopen) { # must close file to update EOF marker for stat print 'not ' unless (-s $outfile == 10); print "ok 31\n"; -close(O); - open(I, $outfile) || die "sysio.t: cannot read $outfile: $!"; $b = 'xyz'; @@ -240,6 +238,17 @@ unlink $outfile; chdir('..'); +# [perl #67912] syswrite prints garbage if called with empty scalar and non-zero offset +eval { my $buf = ''; syswrite(O, $buf, 1, 0) }; +print 'not ' unless ($@ =~ /^Offset outside string /); +print "ok 43\n"; + +eval { my $buf = 'x'; syswrite(O, $buf, 1, 1) }; +print 'not ' unless ($@ =~ /^Offset outside string /); +print "ok 44\n"; + +close(O); + 1; # eof