[svn:parrot] r38725 - trunk/t/op

NotFound at svn.parrot.org NotFound at svn.parrot.org
Tue May 12 21:19:39 UTC 2009


Author: NotFound
Date: Tue May 12 21:19:39 2009
New Revision: 38725
URL: https://trac.parrot.org/parrot/changeset/38725

Log:
[test] add a test for pipe reading, TT #661

Modified:
   trunk/t/op/io.t

Modified: trunk/t/op/io.t
==============================================================================
--- trunk/t/op/io.t	Tue May 12 20:53:11 2009	(r38724)
+++ trunk/t/op/io.t	Tue May 12 21:19:39 2009	(r38725)
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 2;
+use Parrot::Test tests => 3;
 
 =head1 NAME
 
@@ -51,6 +51,45 @@
 Catched
 OUTPUT
 
+TODO: {
+local $TODO = 'Testing' unless $^O =~ /linux/;
+
+pir_output_like( <<'CODE', <<'OUTPUT', 'open pipe for reading' );
+.include 'iglobals.pasm'
+
+.sub testreadpipe :main
+  .local pmc interp
+  interp = getinterp
+  .local pmc conf
+  conf = interp[.IGLOBALS_CONFIG_HASH]
+  .local string command
+  command = conf['build_dir']
+  .local string aux
+  aux = conf['slash']
+  command .= aux
+  aux = conf['test_prog']
+  command .= aux
+  aux = conf['exe']
+  command .= aux
+  command .= ' -V'
+
+  .local pmc pipe
+  pipe = open command, 'rp'
+  unless pipe goto failed
+  .local string line
+nextline:
+  line = readline pipe
+  print line
+  if pipe goto nextline
+  .return()
+failed:
+  say 'FAILED'
+.end
+CODE
+/This is Parrot.*/
+OUTPUT
+}
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list