From: Benjamin Sugars Date: Wed, 9 May 2001 18:03:45 +0000 (-0400) Subject: Additional test case for PerlIO::Scalar X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23a2eb0a7bc4c2d6efcbdf056cb24868d7a4b91d;p=p5sagit%2Fp5-mst-13.2.git Additional test case for PerlIO::Scalar Message-ID: p4raw-id: //depot/perl@10061 --- diff --git a/t/lib/io_scalar.t b/t/lib/io_scalar.t index 14bbf4d..b1ef199 100644 --- a/t/lib/io_scalar.t +++ b/t/lib/io_scalar.t @@ -10,7 +10,7 @@ BEGIN { } $| = 1; -print "1..19\n"; +print "1..20\n"; my $fh; my $var = "ok 2\n"; @@ -86,3 +86,16 @@ print $fh "is here"; print "# Got [$var], expect [Something else is here]\n"; print "not " unless $var eq "Something else is here"; print "ok 19\n"; +close $fh; + +# Check that updates to the scalar from elsewhere do not +# cause problems +$var = "line one\nline two\line three\n"; +open $fh, "<", \$var; +while (<$fh>) { + $var = "foo"; +} +close $fh; +print "# Got [$var], expect [foo]\n"; +print "not " unless $var eq "foo"; +print "ok 20\n";