Multiple consecutive writes on PerlIO::Scalar
[p5sagit/p5-mst-13.2.git] / t / lib / io_scalar.t
index 569abd7..83716c6 100644 (file)
@@ -3,14 +3,14 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
-    unless (defined &perlio::import) {
+    unless (exists $open::layers{'perlio'}) {
        print "1..0 # Skip: not perlio\n";
        exit 0;
     }
 }
 
 $| = 1;
-print "1..9\n";
+print "1..10\n";
 
 my $fh;
 my $var = "ok 2\n";
@@ -32,4 +32,10 @@ print "not " if eof($fh);
 print "ok 8\n";
 print "not " unless <$fh> eq "foo\n";
 print "ok 9\n";
-
+# Test multiple consecutive writes to $var
+$var = "";
+seek($fh, 0, 0);
+print $fh "Fred and Wilma ";
+print $fh "Flintstone";
+print "not " unless $var eq "Fred and Wilma Flintstone";
+print "ok 10\n";