develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34534 - in trunk/t: compilers/pge/p5regex compilers/pge/perl6regex library oo op pmc

From:
coke
Date:
December 28, 2008 17:53
Subject:
[svn:parrot] r34534 - in trunk/t: compilers/pge/p5regex compilers/pge/perl6regex library oo op pmc
Message ID:
20081229015307.7A095CB9FA@x12.develooper.com
Author: coke
Date: Sun Dec 28 17:53:06 2008
New Revision: 34534

Modified:
   trunk/t/compilers/pge/p5regex/p5rx.t
   trunk/t/compilers/pge/perl6regex/01-regex.t
   trunk/t/library/streams.t
   trunk/t/oo/methods.t
   trunk/t/op/sprintf.t
   trunk/t/pmc/eval.t
   trunk/t/pmc/freeze.t
   trunk/t/pmc/io.t
   trunk/t/pmc/packfile.t
   trunk/t/pmc/sys.t

Log:
Remove all deprecated open types from 'make test'



Modified: trunk/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- trunk/t/compilers/pge/p5regex/p5rx.t	(original)
+++ trunk/t/compilers/pge/p5regex/p5rx.t	Sun Dec 28 17:53:06 2008
@@ -122,7 +122,7 @@
     test_file = test_dir . test_name
 
     # Open the test file
-    file_handle = open test_file, '<'
+    file_handle = open test_file, 'r'
     $S0 = typeof file_handle
     if $S0 == 'Undef' goto bad_file
 

Modified: trunk/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- trunk/t/compilers/pge/perl6regex/01-regex.t	(original)
+++ trunk/t/compilers/pge/perl6regex/01-regex.t	Sun Dec 28 17:53:06 2008
@@ -137,7 +137,7 @@
     test_file = test_dir . test_name
 
     # Open the test file
-    file_handle = open test_file, '<'
+    file_handle = open test_file, 'r'
     $S0 = typeof file_handle
     if $S0 == 'Undef' goto bad_file
 

Modified: trunk/t/library/streams.t
==============================================================================
--- trunk/t/library/streams.t	(original)
+++ trunk/t/library/streams.t	Sun Dec 28 17:53:06 2008
@@ -350,7 +350,7 @@
 
     # create a file stream
     file = new "Stream::ParrotIO"
-    file."open"( name, "<" )
+    file."open"( name, 'r' )
 
     # process it one line per read
     lines = new "Stream::Lines"
@@ -948,7 +948,7 @@
     stream = new "Stream::ParrotIO"
 
     # open this file
-    stream."open"( "t/library/perlhist.txt", "<" )
+    stream."open"( "t/library/perlhist.txt", 'r' )
 
     # you can specifiy a custom block size with
     # stream."blockSize"( 10 )

Modified: trunk/t/oo/methods.t
==============================================================================
--- trunk/t/oo/methods.t	(original)
+++ trunk/t/oo/methods.t	Sun Dec 28 17:53:06 2008
@@ -36,7 +36,7 @@
     .local string filename
 
     filename = "method_library.pir"
-    file = open filename, ">"
+    file = open filename, 'w'
 
     $S0 = <<'END'
     .namespace['Foo']

Modified: trunk/t/op/sprintf.t
==============================================================================
--- trunk/t/op/sprintf.t	(original)
+++ trunk/t/op/sprintf.t	Sun Dec 28 17:53:06 2008
@@ -125,7 +125,7 @@
 
     # Open the test file
     .local pmc file_handle   # currently open file
-               file_handle = open test_file, '<'
+               file_handle = open test_file, 'r'
 
     unless file_handle goto bad_file
 

Modified: trunk/t/pmc/eval.t
==============================================================================
--- trunk/t/pmc/eval.t	(original)
+++ trunk/t/pmc/eval.t	Sun Dec 28 17:53:06 2008
@@ -251,12 +251,12 @@
   .local pmc io
   f1 = compi("foo_1", "hello from foo_1")
   \$S0 = f1
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, \$S0
   close io
   load_bytecode "$temp_pbc"
   f2 = compi("foo_2", "hello from foo_2")
-  io = open "$temp2_pbc", ">"
+  io = open "$temp2_pbc", 'w'
   print io, f2
   close io
   load_bytecode "$temp2_pbc"
@@ -325,14 +325,14 @@
   .local pmc io, os
   f1 = compi("foo_1", "hello from foo_1")
   \$S0 = f1
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, \$S0
   close io
   load_bytecode "$temp_pbc"
   os = new 'OS'
   os.'rm'("$temp_pbc")
   f2 = compi("foo_2", "hello from foo_2")
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, f2
   close io
   load_bytecode "$temp_pbc"
@@ -368,7 +368,7 @@
   .local pmc io
   f = compi("foo_1", "hello from foo_1")
   \$S0 = freeze f
-  io = open "$temp_file", ">"
+  io = open "$temp_file", 'w'
   print io, \$S0
   close io
   say "written"
@@ -403,7 +403,7 @@
     file = "$temp_file"
     .include "stat.pasm"
     size = stat file, .STAT_FILESIZE
-    io = open file, "<"
+    io = open file, 'r'
     \$S0 = read io, size
     close io
     e = thaw \$S0
@@ -422,7 +422,7 @@
   .local pmc io
   f = compi("foo_1", "hello from foo_1")
   \$S0 = freeze f
-  io = open "$temp_file", ">"
+  io = open "$temp_file", 'w'
   print io, \$S0
   close io
   say "written"
@@ -460,7 +460,7 @@
     file = "$temp_file"
     .include "stat.pasm"
     size = stat file, .STAT_FILESIZE
-    io = open file, "<"
+    io = open file, 'r'
     \$S0 = read io, size
     close io
     e = thaw \$S0

Modified: trunk/t/pmc/freeze.t
==============================================================================
--- trunk/t/pmc/freeze.t	(original)
+++ trunk/t/pmc/freeze.t	Sun Dec 28 17:53:06 2008
@@ -349,7 +349,7 @@
     print "\n"
     freeze S11, P10
     print "ok 1\n"
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S11
     close P3
     print "ok 2\n"
@@ -368,7 +368,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
     print "ok 1\n"
@@ -411,7 +411,7 @@
     print "\n"
     freeze S11, P10
     print "ok 1\n"
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S11
     close P3
     print "ok 2\n"
@@ -430,7 +430,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
     # print S3
@@ -468,7 +468,7 @@
     print S10
     print "\n"
     freeze S3, P10
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S3
     close P3
 
@@ -515,7 +515,7 @@
     new P10, "Foo"
     print S10
     freeze S3, P10
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S3
     close P3
     print "ok 1\n"
@@ -557,7 +557,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
 

Modified: trunk/t/pmc/io.t
==============================================================================
--- trunk/t/pmc/io.t	(original)
+++ trunk/t/pmc/io.t	Sun Dec 28 17:53:06 2008
@@ -94,10 +94,10 @@
 my (undef, $temp_file) = create_tempfile( UNLINK => 1 );
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "open/close" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     read S0, P0, 20
     print S0
     end
@@ -107,12 +107,12 @@
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "timely destruction" );
     interpinfo I0, 2    # DOD runs
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
         needs_destroy P0
     print P0, "a line\\n"
     null P0            # kill it
     sweep 0            # a lazy DOD has to close the PIO
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     read S0, P0, 20
     print S0
     end
@@ -125,7 +125,7 @@
 .sub main :main
     getstdout $P0
     $I0 = $P0.'get_fd'()
-    fdopen $P1, $I0, ">"
+    fdopen $P1, $I0, 'w'
     defined $I0, $P1
     unless $I0, nok
     print $P1, "ok\n"
@@ -143,7 +143,7 @@
 .sub main :main
     getstdout $P0
     $I0 = $P0.'get_fd'()
-    fdopen $P1, $I0, ">"
+    fdopen $P1, $I0, 'w'
     defined $I0, $P1
     unless $I0, nok
     print $P1, "ok\n"
@@ -159,18 +159,18 @@
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "get_bool" );
     push_eh read_non_existent_file
-    open P0, "$no_such_file", "<"
+    open P0, "$no_such_file", 'r'
 
     print "Huh: '$no_such_file' exists? - not "
 ok1:
     say "ok 1"
 
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     print P0, "a line\\n"
     close P0
 
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     if P0, ok2
     print "not "
 ok2:    say "ok 2"
@@ -241,7 +241,7 @@
 SKIP: {
     skip( "clone not finished yet", 1 );
     pasm_output_is( <<"CODE", <<'OUTPUT', "clone" );
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     clone P1, P0
     read S0, P1, 1024
     print S0
@@ -320,13 +320,13 @@
 
 # write to file opened for reading
 pasm_output_is( <<"CODE", <<'OUTPUT', "3-arg open" );
-   open P1, "$temp_file", ">"
+   open P1, "$temp_file", 'w'
    print P1, "Foobar\\n"
    close P1
 
    push_eh _print_to_read_only
 
-   open P2, "$temp_file", "<"
+   open P2, "$temp_file", 'r'
    print P2, "baz\\n"
    say "skipped"
 
@@ -336,7 +336,7 @@
 
    close P2
 
-   open P3, "$temp_file", "<"
+   open P3, "$temp_file", 'r'
    readline S1, P3
    close P3
    print S1
@@ -363,7 +363,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", '', 'append' );
-   open P1, "$temp_file", ">>"
+   open P1, "$temp_file", 'wa'
    print P1, "Parrot flies\\n"
    close P1
    end
@@ -375,7 +375,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", '', 'write to file' );
-   open P1, "$temp_file", ">"
+   open P1, "$temp_file", 'w'
    print P1, "Parrot overwrites\\n"
    close P1
    end
@@ -389,7 +389,7 @@
    set I0, 0
    set I1, 10000
 
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
 
 PRINT:
    ge I0, I1, END
@@ -408,7 +408,7 @@
 
 pir_output_is( <<"CODE", <<'OUTPUT', "turn off buffering" );
 .sub main :main
-   open \$P0, "$temp_file", ">"
+   open \$P0, "$temp_file", 'w'
 
 #  set buffer type
    \$P0.'buffer_type'('unbuffered')
@@ -435,7 +435,7 @@
 .sub main
     .local string filename
     filename = "$temp_file"
-    \$P1 = open filename, ">"
+    \$P1 = open filename, 'w'
     .local int count, max, nltest
     count = 0
     max = 10000
@@ -582,7 +582,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', 'seek/tell' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    print P0, "Hello "
    tell I0, P0
    print P0, "World!"
@@ -590,7 +590,7 @@
    print P0, "Parrot!\\n"
    close P0
    say "ok 1"
-   open P0, "$temp_file", "<"
+   open P0, "$temp_file", 'r'
    read S0, P0, 65635
    print S0
    end
@@ -600,7 +600,7 @@
 OUTPUT
 
 pasm_error_output_like( <<"CODE", <<'OUTPUT', '32bit seek: exception' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    seek P0, -1, 0
    say "error!"
    end
@@ -609,7 +609,7 @@
 OUTPUT
 
 pasm_error_output_like( <<"CODE", <<'OUTPUT', '64bit seek: exception' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    seek P0, -1, -1, 0
    say "error!"
    end
@@ -618,10 +618,10 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "peek" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     peek S0, P0
     print S0
     peek S1, P0
@@ -638,9 +638,9 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "peek on an empty file" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     peek S0, P0
     eq S0, "", OK1
     print "not "
@@ -655,13 +655,13 @@
 .sub _main
     # Write something into a file
     .local pmc out
-    out = open "$temp_file", ">"
+    out = open "$temp_file", 'w'
     print out, "0123456789\\n"
     close out
 
     # read file contents back in
     .local pmc in
-    in = open "$temp_file", "<"
+    in = open "$temp_file", 'r'
     .local string from_file
     from_file = read in, 20
 
@@ -681,13 +681,13 @@
 .sub _main
     # Write something into a file
     .local pmc out
-    out = open "$temp_file", ">"
+    out = open "$temp_file", 'w'
     print out, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\\n"
     close out
 
     .local pmc in
     .local string line
-    in = open '$temp_file', '<'
+    in = open '$temp_file', 'r'
     line = read in, 50000
     close in
 
@@ -741,7 +741,7 @@
     .local string f
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = read pio, len
     close pio
@@ -768,7 +768,7 @@
     .local pmc pio
     .local string f
     f = '$temp_file'
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = readline pio
     close pio
@@ -798,7 +798,7 @@
     .local string f
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = read pio, 2
     len -= 2
@@ -852,7 +852,7 @@
 line 3
 EOS
     .local pmc pio, cl
-    pio = open    "$temp_file", ">"
+    pio = open    "$temp_file", 'w'
     print pio, \$S0
     close pio
     cl = new 'FileHandle'
@@ -874,10 +874,10 @@
 line 3
 EOS
     .local pmc pio, pio2
-    pio = open    "$temp_file", ">"
+    pio = open    "$temp_file", 'w'
     print pio, \$S0
     close pio
-    pio2 = open    "$temp_file", "<"
+    pio2 = open    "$temp_file", 'r'
     \$S1 = pio2.'readall'()
     if \$S0 == \$S1 goto ok
     print "not "

Modified: trunk/t/pmc/packfile.t
==============================================================================
--- trunk/t/pmc/packfile.t	(original)
+++ trunk/t/pmc/packfile.t	Sun Dec 28 17:53:06 2008
@@ -79,7 +79,7 @@
     $S0  = interpinfo .INTERPINFO_RUNTIME_PREFIX
     $S0 .= "/runtime/parrot/library/uuid.pbc"
     $I0  = stat $S0, .STAT_FILESIZE
-    pio  = open $S0, "<"
+    pio  = open $S0, 'r'
     $S0  = read pio, $I0
     close pio
     pf   = $S0

Modified: trunk/t/pmc/sys.t
==============================================================================
--- trunk/t/pmc/sys.t	(original)
+++ trunk/t/pmc/sys.t	Sun Dec 28 17:53:06 2008
@@ -31,7 +31,7 @@
 
 .sub _test :main
      .local pmc O
-     open O, "$temp_pir", ">"
+     open O, "$temp_pir", 'w'
      print O, ".sub _main :main\\n"
      print O, "\tsay \\"Hello, World!\\"\\n"
      print O, ".end\\n"



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About