[svn:parrot] r47226 - trunk/t/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Mon May 31 14:14:39 UTC 2010
Author: bacek
Date: Mon May 31 14:14:38 2010
New Revision: 47226
URL: https://trac.parrot.org/parrot/changeset/47226
Log:
Migrate most of the test to dynopsless variant to avoid dependency on opsc.
Modified:
trunk/t/pmc/eval.t
Modified: trunk/t/pmc/eval.t
==============================================================================
--- trunk/t/pmc/eval.t Mon May 31 14:01:04 2010 (r47225)
+++ trunk/t/pmc/eval.t Mon May 31 14:14:38 2010 (r47226)
@@ -245,21 +245,21 @@
my (undef, $temp2_pbc) = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 );
pir_output_is( <<"CODE", <<'OUTPUT', "eval.get_string" );
-.loadlib 'io_ops'
.sub main :main
.local pmc f1, f2
.local pmc io
f1 = compi("foo_1", "hello from foo_1")
\$S0 = f1
- io = open "$temp_pbc", 'w'
+ io = new ['FileHandle']
+ io.'open'("$temp_pbc", 'w')
print io, \$S0
- close io
+ io.'close'()
load_bytecode "$temp_pbc"
f2 = compi("foo_2", "hello from foo_2")
- io = open "$temp2_pbc", 'w'
+ io.'open'("$temp2_pbc", 'w')
print io, f2
- close io
+ io.'close'()
load_bytecode "$temp2_pbc"
.end
@@ -321,23 +321,23 @@
close $fh;
pir_output_is( <<"CODE", <<'OUTPUT', "eval.get_string - same file" );
-.loadlib 'io_ops'
.sub main :main
.local pmc f1, f2
.local pmc io, os
f1 = compi("foo_1", "hello from foo_1")
\$S0 = f1
- io = open "$temp_pbc", 'w'
+ io = new ['FileHandle']
+ io.'open'("$temp_pbc", 'w')
print io, \$S0
- close io
+ io.'close'()
load_bytecode "$temp_pbc"
\$P0 = loadlib 'os'
os = new ['OS']
os.'rm'("$temp_pbc")
f2 = compi("foo_2", "hello from foo_2")
- io = open "$temp_pbc", 'w'
+ io.'open'("$temp_pbc", 'w')
print io, f2
- close io
+ io.'close'()
load_bytecode "$temp_pbc"
.end
@@ -365,15 +365,15 @@
my (undef, $temp_file) = create_tempfile( UNLINK => 1 );
pir_output_is( <<"CODE", <<'OUTPUT', "eval.freeze" );
-.loadlib 'io_ops'
.sub main :main
.local pmc f, e
.local pmc io
f = compi("foo_1", "hello from foo_1")
\$S0 = freeze f
- io = open "$temp_file", 'w'
+ io = new ['FileHandle']
+ io.'open'("$temp_file", 'w')
print io, \$S0
- close io
+ io.'close'()
say "written"
.end
@@ -399,7 +399,6 @@
OUTPUT
pir_output_is( <<"CODE", <<'OUTPUT', "eval.thaw", todo => 'TT #1142' );
-.loadlib 'io_ops'
.sub main :main
.local pmc io, e
.local string file
@@ -407,9 +406,10 @@
file = "$temp_file"
.include "stat.pasm"
size = stat file, .STAT_FILESIZE
- io = open file, 'r'
+ io = new ['FileHandle']
+ io.'open'(file, 'r')
\$S0 = read io, size
- close io
+ io.'close'()
e = thaw \$S0
sweep 1 # ensure all of the object survives GC
e()
@@ -422,15 +422,15 @@
OUTPUT
pir_output_is( <<"CODE", <<'OUTPUT', "eval.freeze+thaw" );
-.loadlib 'io_ops'
.sub main :main
.local pmc f, e
.local pmc io
f = compi("foo_1", "hello from foo_1")
\$S0 = freeze f
- io = open "$temp_file", 'w'
+ io = new ['FileHandle']
+ io.'open'("$temp_file", 'w')
print io, \$S0
- close io
+ io.'close'()
say "written"
"read"()
.end
@@ -466,9 +466,9 @@
file = "$temp_file"
.include "stat.pasm"
size = stat file, .STAT_FILESIZE
- io = open file, 'r'
+ io.'open'(file, 'r')
\$S0 = read io, size
- close io
+ io.'close'()
e = thaw \$S0
e()
e = get_global "foo_1"
More information about the parrot-commits
mailing list