--- t/pmc/io2.t	Thu Jan 22 21:17:28 2004
+++ t/pmc/io.t	Thu Jan 22 21:11:51 2004
@@ -1,6 +1,6 @@
 #! perl -w
 
-use Parrot::Test tests => 21;
+use Parrot::Test tests => 25;
 use Test::More;
 
 output_is(<<'CODE', <<'OUTPUT', "open/close");
@@ -273,6 +273,55 @@
 
 close FOO;
 
+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 FOO, "temp.file";
+
+ok(<FOO> eq <<DATA x 10000, 'file content');
+words
+DATA
+
+close FOO;
+
+output_is(<<'CODE', '', "turn off buffering");
+       open P0, "temp.file", ">"
+
+       save P0
+       find_method P10, P0, "setbuf"
+       set P5, P0
+       set I5, 0
+       invoke P10
+       restore P0
+
+       print P0, "Howdy World\n"
+
+       close P0
+       end
+CODE
+
+open FOO, "temp.file";
+
+is(<FOO>, <<DATA, 'file content');
+Howdy World
+DATA
+
+close FOO;
+
 unlink("temp.file");
 
 output_is(<<'CODE', <<'OUT', 'standard file descriptors');
