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

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sun Jun 28 16:36:39 UTC 2009


Author: fperrad
Date: Sun Jun 28 16:36:36 2009
New Revision: 39814
URL: https://trac.parrot.org/parrot/changeset/39814

Log:
[t] add a missing todo
- replace a deprecated mode
- remove a magic number
- and minor improvements

Modified:
   trunk/t/op/io.t

Modified: trunk/t/op/io.t
==============================================================================
--- trunk/t/op/io.t	Sun Jun 28 07:43:32 2009	(r39813)
+++ trunk/t/op/io.t	Sun Jun 28 16:36:36 2009	(r39814)
@@ -31,7 +31,8 @@
 
 .sub 'open_null_filename'
     push_eh open_null_filename_failed
-    $P0 = open $S0, '<'
+    null $S0
+    $P0 = open $S0, 'r'
     nok(1, 'open with null filename')
     .return ()
 
@@ -41,6 +42,7 @@
 
 .sub 'open_null_mode'
     push_eh open_null_mode_failed
+    null $S0
     $P0 = open 'some_name', $S0
     nok(1, 'open with null mode')
     .return ()
@@ -49,10 +51,11 @@
     ok(1, 'open with null mode')
 .end
 
-.sub 'tt661_todo_test'
+.sub 'tt661_todo_test' :anon
     # Checks whether the platform is linux, MSWin32, darwin: on other
     # platforms, the following tests are todo'ed.
-    $S0 = sysinfo 4
+    .include 'sysinfo.pasm'
+    $S0 = sysinfo .SYSINFO_PARROT_OS
     if $S0 == 'linux' goto tt661_ok
     if $S0 == 'MSWin32' goto tt661_ok
     if $S0 == 'darwin' goto tt661_ok
@@ -60,15 +63,15 @@
     .return (0)
 
   tt661_ok:
-    .return(1)
+    .return (1)
 .end
 
+.include 'iglobals.pasm'
+
 .sub 'open_pipe_for_reading'
     $I0 = tt661_todo_test()
     unless $I0 goto open_pipe_for_reading_todoed
 
-    .include 'iglobals.pasm'
-
     .local pmc interp
     interp = getinterp
 
@@ -93,7 +96,7 @@
     .local string line
     line = readline pipe
     like('This is Parrot', ":s This is Parrot", 'open pipe for reading')
-    .return()
+    .return ()
 
   open_pipe_for_reading_failed:
     nok(1, 'open pipe for reading')
@@ -104,17 +107,18 @@
 .end
 
 .sub 'open_pipe_for_writing'
-    .include 'iglobals.pasm'
-    
+    $I0 = tt661_todo_test()
+    unless $I0 goto open_pipe_for_writing_todoed
+
     .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
@@ -133,7 +137,7 @@
     unless pipe goto open_pipe_for_writing_failed
     pipe.'puts'("ok - open pipe for writing\n")
     close pipe
-    .return()
+    .return ()
 
   open_pipe_for_writing_failed:
     nok(1, 'open pipe for writing')


More information about the parrot-commits mailing list