--- t/src/io.t.bak	Wed Jan 21 20:19:59 2004
+++ t/src/io.t	Wed Jan 21 21:32:10 2004
@@ -1,6 +1,6 @@
 #! perl -w
 
-use Parrot::Test tests => 17;
+use Parrot::Test tests => 21;
 use Test::More;
 
 $/=undef; # slurp mode
@@ -379,6 +379,59 @@
 15
 OUTPUT
 
+teardown();
+
+###############################################################################
+
+output_is(<<'CODE', '', "PIO_flush on buffer full");
+    set I0, 0
+    set I1, 10000
+
+    open P0, "temp.file", ">"
+
+PRINT:
+    ge I0, I1, END
+    print P0, "words\n"
+    inc I0
+    branch PRINT
+
+END:
+    close P0
+    end
+CODE
+
+open FILE, "temp.file";
+ok(<FILE> eq <<DATA x 10000, 'file content');
+words
+DATA
+close FILE;
+
+teardown();
+
+###############################################################################
+
+output_is(<<'CODE', '', "turn off buffering");
+    open P0, "temp.file", ">"
+
+    find_method P10, P0, "setbuf"
+    set P5, P0
+    set I5, 0
+    invoke P10
+
+    print P0, "Howdy World\n"
+
+    close P0
+    end
+CODE
+
+open FILE, "temp.file";
+is(<FILE>, <<DATA, 'file content');
+Howdy World
+DATA
+close FILE;
+
+teardown();
+
 ###############################################################################
 # PIO_unix_close and PIO_win32_close return NULL.
 
