[svn:parrot] r47281 - in trunk/t: oo pmc
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Wed Jun 2 04:57:03 UTC 2010
Author: plobsing
Date: Wed Jun 2 04:57:02 2010
New Revision: 47281
URL: https://trac.parrot.org/parrot/changeset/47281
Log:
un-dynext some coretests
Modified:
trunk/t/oo/methods.t
trunk/t/pmc/stringhandle.t
Modified: trunk/t/oo/methods.t
==============================================================================
--- trunk/t/oo/methods.t Wed Jun 2 04:16:16 2010 (r47280)
+++ trunk/t/oo/methods.t Wed Jun 2 04:57:02 2010 (r47281)
@@ -16,6 +16,8 @@
=cut
+.const string library_file = "method_library.pir"
+
.sub main :main
.include 'test_more.pir'
@@ -29,17 +31,15 @@
overridden_core_pmc()
- delete_library()
+ try_delete_library()
.end
.sub create_library
.local pmc file
- .local string filename
- filename = "method_library.pir"
file = new ['FileHandle']
- file.'open'(filename, 'w')
+ file.'open'(library_file, 'w')
$S0 = <<'END'
.namespace['Foo']
@@ -53,12 +53,18 @@
.end
-.sub delete_library
+.sub try_delete_library
.local pmc os
$P0 = loadlib 'os'
+ unless $P0 goto no_os
os = new 'OS'
- $S0 = "method_library.pir"
- os.'rm'($S0)
+ os.'rm'(library_file)
+ .return ()
+
+ no_os:
+ $S1 = concat "WARNING: could not delete test file `", library_file
+ $S1 = concat $S1, "' because the OS PMC is unavailable"
+ diag($S1)
.end
.sub loading_methods_from_file
@@ -67,7 +73,7 @@
$I0 = $P1.'foo_method'()
ok ($I0, 'calling foo_method')
- load_bytecode 'method_library.pir'
+ load_bytecode library_file
$P1 = new 'Foo'
$I0 = $P1.'bar_method'()
ok ($I0, 'calling bar_method')
Modified: trunk/t/pmc/stringhandle.t
==============================================================================
--- trunk/t/pmc/stringhandle.t Wed Jun 2 04:16:16 2010 (r47280)
+++ trunk/t/pmc/stringhandle.t Wed Jun 2 04:57:02 2010 (r47281)
@@ -139,25 +139,25 @@
$P0.'open'('README', 'w')
print $P0, "This is Parrot, version"
- close $P0
+ $P0.'close'()
$P0.'open'('README')
- $S0 = read $P0, 14 # bytes
+ $S0 = $P0.'read'(14) # bytes
if $S0 == 'This is Parrot' goto ok_1
print 'not '
ok_1:
- say 'ok 1 - $S0 = read $P1, $I2'
+ say 'ok 1 - $S0 = $P1.read($I2)'
- $S0 = read $P0, 9 # bytes
+ $S0 = $P0.'read'(9) # bytes
if $S0 == ', version' goto ok_2
print 'not '
ok_2:
- say 'ok 2 - $S0 = read $P1, $I2 # again on same stream'
+ say 'ok 2 - $S0 = $P1.read($I2) # again on same stream'
.end
CODE
-ok 1 - $S0 = read $P1, $I2
-ok 2 - $S0 = read $P1, $I2 # again on same stream
+ok 1 - $S0 = $P1.read($I2)
+ok 2 - $S0 = $P1.read($I2) # again on same stream
OUT
# L<PDD22/I\/O PMC API/=item print>
More information about the parrot-commits
mailing list