Author: cotto
Date: Wed Jan 7 18:49:58 2009
New Revision: 35185
Modified:
trunk/t/pmc/exception.t
trunk/t/pmc/exceptionhandler.t
trunk/t/pmc/exporter.t
trunk/t/pmc/file.t
trunk/t/pmc/filehandle.t
trunk/t/pmc/fixedbooleanarray.t
trunk/t/pmc/fixedfloatarray.t
trunk/t/pmc/fixedintegerarray.t
trunk/t/pmc/fixedpmcarray.t
Log:
[t] more test updates
Modified: trunk/t/pmc/exception.t
==============================================================================
--- trunk/t/pmc/exception.t (original)
+++ trunk/t/pmc/exception.t Wed Jan 7 18:49:58 2009
@@ -37,7 +37,7 @@
pir_output_is( <<'CODE', <<'OUTPUT', "push_eh - pop_eh, PMC exception handler"
);
.sub main :main
- $P0 = new "ExceptionHandler"
+ $P0 = new ['ExceptionHandler']
set_addr $P0, _handler
push_eh $P0
print "ok 1\n"
@@ -56,7 +56,7 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw" );
print "main\n"
push_eh _handler
- new P30, 'Exception'
+ new P30, ['Exception']
throw P30
print "not reached\n"
end
@@ -70,10 +70,10 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw, PMC exception handler"
);
print "main\n"
- new P20, "ExceptionHandler"
+ new P20, ['ExceptionHandler']
set_addr P20, _handler
push_eh P20
- new P30, 'Exception'
+ new P30, ['Exception']
throw P30
print "not reached\n"
end
@@ -88,8 +88,8 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "get_results" );
print "main\n"
push_eh handler
- new P1, 'Exception'
- new P2, 'String'
+ new P1, ['Exception']
+ new P2, ['String']
set P2, "just pining"
setattribute P1, 'message', P2
throw P1
@@ -117,17 +117,17 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "exception attributes" );
print "main\n"
push_eh handler
- new P1, 'Exception'
- new P2, 'String'
+ new P1, ['Exception']
+ new P2, ['String']
set P2, "just pining"
setattribute P1, 'message', P2
- new P3, 'Integer'
+ new P3, ['Integer']
set P3, 5
setattribute P1, 'severity', P3
- new P4, 'String'
+ new P4, ['String']
set P4, "additional payload"
setattribute P1, 'payload', P4
- new P5, 'Array'
+ new P5, ['Array']
set P5, 2
set P5[0], 'backtrace line 1'
set P5[1], 'backtrace line 2'
@@ -172,10 +172,10 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "get_results - be sure registers are ok"
);
# see also #38459
print "main\n"
- new P0, 'Integer'
+ new P0, ['Integer']
push_eh handler
- new P1, 'Exception'
- new P2, 'String'
+ new P1, ['Exception']
+ new P2, ['String']
set P2, "just pining"
setattribute P1, 'message', P2
throw P1
@@ -196,8 +196,8 @@
.sub main :main
print "main\n"
push_eh _handler
- new $P1, 'Exception'
- new $P2, 'String'
+ $P1 = new ['Exception']
+ $P2 = new ['String']
set $P2, "just pining"
setattribute $P1, 'message', $P2
throw $P1
@@ -227,8 +227,8 @@
print "main\n"
push_eh _handler
- new P30, 'Exception'
- new P20, 'String'
+ new P30, ['Exception']
+ new P20, ['String']
set P20, "something happened"
setattribute P30, "message", P20
throw P30
@@ -248,8 +248,8 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler" );
- new P0, 'Exception'
- new P20, 'String'
+ new P0, ['Exception']
+ new P20, ['String']
set P20, "something happened"
setattribute P0, "message", P20
throw P0
@@ -261,7 +261,7 @@
pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message"
);
push_eh _handler
- new P0, 'Exception'
+ new P0, ['Exception']
pop_eh
throw P0
print "not reached\n"
@@ -273,7 +273,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message"
);
- new P0, 'Exception'
+ new P0, ['Exception']
throw P0
print "not reached\n"
end
@@ -286,8 +286,8 @@
push_eh _handler1
push_eh _handler2
- new P30, 'Exception'
- new P20, 'String'
+ new P30, ['Exception']
+ new P20, ['String']
set P20, "something happened"
setattribute P30, "message", P20
throw P30
@@ -318,8 +318,8 @@
push_eh _handler1
push_eh _handler2
- new P30, 'Exception'
- new P20, 'String'
+ new P30, ['Exception']
+ new P20, ['String']
set P20, "something happened"
setattribute P30, "message", P20
throw P30
@@ -401,7 +401,7 @@
print "main\n"
push_eh handler
print "ok\n"
- new P30, 'Exception'
+ new P30, ['Exception']
throw P30
print "not reached\n"
end
@@ -456,7 +456,7 @@
.sub main :main
$P0 = get_hll_global ['Foo'], 'load'
$P0()
- $P0 = new 'Foo'
+ $P0 = new ['Foo']
push_eh catch
$S0 = $P0
pop_eh
@@ -475,7 +475,7 @@
.end
.sub get_string :vtable :method
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
throw $P0
.end
CODE
@@ -487,7 +487,7 @@
print "main\n"
.const 'Sub' at_exit = "exit_handler"
pushaction at_exit
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
throw $P0
.return()
.end
@@ -511,7 +511,7 @@
print "main\n"
.const 'Sub' at_exit = "exit_handler"
pushaction at_exit
- $P1 = new 'Exception'
+ $P1 = new ['Exception']
throw $P1
print "never 1\n"
h:
@@ -524,7 +524,7 @@
.param int flag
print "at_exit, flag = "
say flag
- $P2 = new 'Exception'
+ $P2 = new ['Exception']
throw $P2
print "never 2\n"
.end
@@ -542,7 +542,7 @@
.sub main :main
.local pmc a
.lex 'a', a
- a = new 'Integer'
+ a = new ['Integer']
a = 42
push_eh handler
exit 0
@@ -582,8 +582,8 @@
.end
.sub broken
- $P0 = new 'Exception'
- new $P2, 'String'
+ $P0 = new ['Exception']
+ new $P2, ['String']
set $P2, "something broke"
setattribute $P0, "message", $P2
throw $P0
@@ -634,14 +634,14 @@
.sub foo
## Take a continuation.
.local pmc cont
- cont = new 'Continuation'
+ cont = new ['Continuation']
set_addr cont, over_there
print " returning from foo\n"
.return (cont)
over_there:
print " got over there.\n"
.local pmc ex
- ex = new 'Exception'
+ ex = new ['Exception']
throw ex
.end
CODE
@@ -684,7 +684,7 @@
.local pmc p, q
- p = new 'Integer'
+ p = new ['Integer']
set p, "0"
push_eh handler
Modified: trunk/t/pmc/exceptionhandler.t
==============================================================================
--- trunk/t/pmc/exceptionhandler.t (original)
+++ trunk/t/pmc/exceptionhandler.t Wed Jan 7 18:49:58 2009
@@ -25,7 +25,7 @@
plan(8)
.local pmc eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
ok(1, 'Instantiated ExceptionHandler')
set_addr eh, nonfatal_handler_one
@@ -33,17 +33,17 @@
eh.'max_severity'(.EXCEPT_WARNING)
push_eh eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, error_handler_one
eh.'min_severity'(.EXCEPT_ERROR)
eh.'max_severity'(.EXCEPT_FATAL)
push_eh eh
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
$P0['severity'] = .EXCEPT_NORMAL
throw $P0
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
$P0['severity'] = .EXCEPT_SEVERE
throw $P0
@@ -69,21 +69,21 @@
more_tests:
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, typed_handler_one
eh.'handle_types'(.CONTROL_OK, .CONTROL_BREAK)
push_eh eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, typed_handler_two
eh.'handle_types'(.EXCEPTION_SYNTAX_ERROR, .EXCEPTION_UNEXPECTED_NULL)
push_eh eh
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
$P0['type'] = .CONTROL_OK
throw $P0
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
$P0['type'] = .CONTROL_BREAK
throw $P0
@@ -135,7 +135,7 @@
.sub subclass_handler_pop
.param pmc myhandler
.local pmc eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, subclassed_popped
push_eh eh
@@ -146,7 +146,7 @@
pop_eh
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
throw $P0
subclassed_popped:
@@ -159,7 +159,7 @@
.sub subclass_handler_catches_can
.param pmc myhandler
.local pmc eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, subclassed_failed
push_eh eh
@@ -168,7 +168,7 @@
set_addr myeh, subclassed_handler
push_eh myeh
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
throw $P0
subclassed_failed:
@@ -181,7 +181,7 @@
.sub subclass_handler_catches
.param pmc myhandler
.local pmc eh
- new eh, 'ExceptionHandler'
+ eh = new ['ExceptionHandler']
set_addr eh, subclassed_failed
push_eh eh
@@ -190,7 +190,7 @@
set_addr myeh, subclassed_handler
push_eh myeh
- $P0 = new 'Exception'
+ $P0 = new ['Exception']
throw $P0
subclassed_failed:
Modified: trunk/t/pmc/exporter.t
==============================================================================
--- trunk/t/pmc/exporter.t (original)
+++ trunk/t/pmc/exporter.t Wed Jan 7 18:49:58 2009
@@ -25,8 +25,8 @@
# L<PDD17/Exporter PMC>
pir_output_is( <<'CODE', <<'OUT', 'new' );
.sub 'test' :main
- $P0 = new 'Exporter'
- say "ok 1 - $P0 = new 'Exporter'"
+ $P0 = new ['Exporter']
+ say "ok 1 - $P0 = new ['Exporter']"
$I0 = isa $P0, 'Exporter'
if $I0 goto ok_2
@@ -35,13 +35,13 @@
say "ok 2 - isa $P0, 'Exporter'"
.end
CODE
-ok 1 - $P0 = new 'Exporter'
+ok 1 - $P0 = new ['Exporter']
ok 2 - isa $P0, 'Exporter'
OUT
pir_output_is( <<'CODE', <<'OUT', 'source' );
.sub 'test' :main
- new $P0, 'Exporter'
+ $P0 = new ['Exporter']
$P1 = $P0.'source'()
if null $P1 goto ok_1
print 'not '
@@ -93,7 +93,7 @@
pir_output_is( <<'CODE', <<'OUT', 'destination' );
.sub 'test' :main
- new $P0, 'Exporter'
+ $P0 = new ['Exporter']
$P1 = $P0.'destination'()
unless null $P1 goto ok_1
print 'not '
@@ -152,7 +152,7 @@
pir_output_is( <<'CODE', <<'OUT', 'globals' );
.sub 'test' :main
- $P0 = new 'Exporter'
+ $P0 = new ['Exporter']
$P1 = $P0.'globals'()
$I0 = isnull $P1
@@ -162,7 +162,7 @@
say 'ok 1 - globals() returns PMCNULL upon Exporter init'
# create an array to store globals in
- $P99 = new 'ResizableStringArray'
+ $P99 = new ['ResizableStringArray']
$P0.'globals'($P99)
$P1 = $P0.'globals'()
@@ -193,7 +193,7 @@
say 'ok 3 - globals() with array arg sets globals hash (hash with two
keys)'
# create a hash to store globals in
- $P99 = new 'Hash'
+ $P99 = new ['Hash']
$P0.'globals'($P99)
$P1 = $P0.'globals'()
@@ -245,7 +245,7 @@
pir_error_output_like( <<'CODE', <<'OUT', 'import - no args' );
.sub 'test' :main
- $P0 = new 'Exporter'
+ $P0 = new ['Exporter']
$P0.'import'()
say 'ok 1 - import() with no args throws an exception'
@@ -261,7 +261,7 @@
src = get_namespace
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), src :named('destination'), 'plan
ok' :named('globals') )
plan(1)
ok(1)
@@ -288,7 +288,7 @@
src = get_namespace [ 'Test'; 'More' ]
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), 'plan ok' :named('globals') )
plan(1)
ok(1)
@@ -305,7 +305,7 @@
src = get_namespace [ 'Test'; 'More' ]
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'source'( src )
exporter.'import'( 'plan ok' :named('globals') )
plan(1)
@@ -322,11 +322,11 @@
.local pmc exporter, src, globals
src = get_namespace [ 'Test'; 'More' ]
- globals = new 'ResizableStringArray'
+ globals = new ['ResizableStringArray']
globals = push 'ok'
globals = push 'plan'
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), globals :named('globals') )
plan(1)
ok(1)
@@ -341,13 +341,13 @@
load_bytecode 'Test/More.pir'
.local pmc exporter, src, globals, nul
- nul = new 'Null'
+ nul = new ['Null']
src = get_namespace [ 'Test'; 'More' ]
- globals = new 'Hash'
+ globals = new ['Hash']
globals['ok'] = nul
globals['plan'] = ''
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), globals :named('globals') )
plan(1)
ok(1)
@@ -363,11 +363,11 @@
.local pmc exporter, src, globals
src = get_namespace [ 'Test'; 'More' ]
- globals = new 'Hash'
+ globals = new ['Hash']
globals['plan'] = 'consilium'
globals['ok'] = 'rectus'
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), globals :named('globals') )
consilium(1)
rectus(1)
@@ -384,11 +384,11 @@
src = get_namespace [ 'Test'; 'More' ]
dest = get_namespace ['foo']
- globals = new 'ResizableStringArray'
+ globals = new ['ResizableStringArray']
globals = push 'ok'
globals = push 'plan'
- exporter = new 'Exporter'
+ exporter = new ['Exporter']
exporter.'import'( src :named('source'), dest :named('destination'),
globals :named('globals') )
$P0 = get_global ['foo'], 'bar'
Modified: trunk/t/pmc/file.t
==============================================================================
--- trunk/t/pmc/file.t (original)
+++ trunk/t/pmc/file.t Wed Jan 7 18:49:58 2009
@@ -47,7 +47,7 @@
# test is_dir
pir_output_is( <<"CODE", <<"OUT", "Test is_dir" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
\$S1 = '$xpto'
\$I1 = \$P1."is_dir"(\$S1)
@@ -78,7 +78,7 @@
# test is_dir
pir_error_output_like( <<"CODE", <<"OUT", "Test is_dir error" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
#make a filename that's long enough to cause lstat to fail
\$I0 = 1000
@@ -98,7 +98,7 @@
# test is_file
pir_output_is( <<"CODE", <<"OUT", "Test is_file" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
\$S1 = '$xpto'
\$I1 = \$P1."is_file"(\$S1)
@@ -129,7 +129,7 @@
# test is_file
pir_error_output_like( <<"CODE", <<"OUT", "Test is_file error" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
#make a filename that's long enough to cause lstat to fail
\$I0 = 1000
@@ -155,7 +155,7 @@
# test is_link
pir_output_is( <<"CODE", <<"OUT", "Test is_link with links to files" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
\$S1 = '$lotpx'
\$I1 = \$P1."is_link"(\$S1)
@@ -190,7 +190,7 @@
# test is_link
pir_output_is( <<"CODE", <<"OUT", "Test is_link with links to directories"
);
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
\$S1 = '$xptol'
\$I1 = \$P1."is_link"(\$S1)
@@ -223,8 +223,8 @@
\$S1 = '$otpx'
\$S2 = '$otpxcopy'
- \$P1 = new 'File'
- \$P2 = new 'OS'
+ \$P1 = new ['File']
+ \$P2 = new ['OS']
\$P1."copy"(\$S1,\$S2)
print "ok\\n"
@@ -256,8 +256,8 @@
\$S1 = '$otpx'
\$S2 = '$otpxcopy'
- \$P1 = new 'File'
- \$P2 = new 'OS'
+ \$P1 = new ['File']
+ \$P2 = new ['OS']
\$P3 = \$P2."stat"(\$S1)
\$I1 = \$P3[7]
@@ -286,7 +286,7 @@
# test exists
pir_output_is( <<"CODE", <<"OUT", "Test rename for files" );
.sub main :main
- \$P1 = new 'File'
+ \$P1 = new ['File']
\$I1 = \$P1.'exists'( '$otpxcopy' )
if \$I1 goto file_exists
Modified: trunk/t/pmc/filehandle.t
==============================================================================
--- trunk/t/pmc/filehandle.t (original)
+++ trunk/t/pmc/filehandle.t Wed Jan 7 18:49:58 2009
@@ -28,11 +28,11 @@
# L<PDD22/I\/O PMC API/=item new>
pir_output_is( <<'CODE', <<'OUT', 'new' );
.sub 'test' :main
- new $P0, 'FileHandle'
- say "ok 1 - $P0 = new 'FileHandle'"
+ $P0 = new ['FileHandle']
+ say "ok 1 - $P0 = new ['FileHandle']"
.end
CODE
-ok 1 - $P0 = new 'FileHandle'
+ok 1 - $P0 = new ['FileHandle']
OUT
my (undef, $temp_file) = create_tempfile( UNLINK => 1 );
@@ -40,14 +40,14 @@
# L<PDD22/I\/O PMC API/=item open.*=item close>
pir_output_is( <<"CODE", <<'OUT', 'open and close - synchronous' );
.sub 'test' :main
- \$P1 = new 'FileHandle'
+ \$P1 = new ['FileHandle']
\$P1.'open'('README')
say 'ok 1 - \$P1.open(\$S1)'
\$P1.'close'()
say 'ok 2 - \$P1.close()'
- \$P3 = new 'FileHandle'
+ \$P3 = new ['FileHandle']
\$P3.'open'('$temp_file', 'rw')
say 'ok 3 - \$P3.open(\$S1, \$S2) # rw mode'
\$P3.'close'()
@@ -57,19 +57,19 @@
\$P3.'close'()
test_5:
- \$P5 = new 'FileHandle'
+ \$P5 = new ['FileHandle']
push_eh eh_bad_file_1
\$P5.'open'('bad.file')
pop_eh
test_6:
- \$P6 = new 'FileHandle'
+ \$P6 = new ['FileHandle']
push_eh eh_bad_file_2
\$P6.'open'('bad.file', 'r')
pop_eh
test_7:
- \$P7 = new 'FileHandle'
+ \$P7 = new ['FileHandle']
\$P7.'open'('$temp_file', 'w')
say 'ok 7 - \$P7.open(\$S1, \$S2) # new file, write mode succeeds'
@@ -103,7 +103,7 @@
pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' );
.sub 'test' :main
$P1 = # RT #46831 create a callback here
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$P0.'open'('README')
say 'ok 1 - $P0.open($S1)'
@@ -133,7 +133,7 @@
pir_output_is(
<<'CODE', <<'OUT', 'read - synchronous' );
.sub 'test' :main
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$P0.'open'('README')
$S0 = $P0.'read'(14) # bytes
@@ -157,7 +157,7 @@
pir_output_is( <<"CODE", <<'OUT', 'print - synchronous' );
.sub 'test' :main
- \$P0 = new 'FileHandle'
+ \$P0 = new ['FileHandle']
\$P0.'open'('$temp_file', 'w')
\$P0.'print'(123)
@@ -166,14 +166,14 @@
say 'ok 2 - \$P0.print(\$N1)'
\$P0.'print'("squawk\\n")
say 'ok 3 - \$P0.print(\$S1)'
- \$P1 = new 'Integer'
+ \$P1 = new ['Integer']
\$P1 = 42
\$P0.'print'(\$P1)
say 'ok 4 - \$P0.print(\$P1)'
\$P0.'close'()
- \$P1 = new 'FileHandle'
+ \$P1 = new ['FileHandle']
\$P1.'open'('$temp_file', 'r')
\$S0 = \$P1.'read'(3) # bytes
@@ -210,12 +210,12 @@
.local pmc chomp
chomp = get_global ['String';'Utils'], 'chomp'
- \$P0 = new 'FileHandle'
+ \$P0 = new ['FileHandle']
\$P0.'open'('$temp_file', 'w')
\$P0.'print'("foobarbaz\\n42")
\$P0.'close'()
- \$P1 = new 'FileHandle'
+ \$P1 = new ['FileHandle']
\$P1.'open'('$temp_file')
\$S0 = \$P1.'readline'()
@@ -255,7 +255,7 @@
.local string test_line
.local pmc filehandle
.local int counter
- filehandle = new 'FileHandle'
+ filehandle = new ['FileHandle']
filehandle.'open'('$temp_file')
counter = 0
@@ -301,7 +301,7 @@
# L<PDD22/I\/O PMC API/=item record_separator>
pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet
implemented' );
.sub 'test' :main
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$S0 = $P0.'record_separator'()
if $S0 == "\n" goto ok_1
@@ -337,7 +337,7 @@
# L<PDD22/I\/O PMC API/=item buffer_type>
pir_output_is( <<'CODE', <<'OUT', 'buffer_type' );
.sub 'test' :main
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$P0.'buffer_type'('unbuffered')
$S0 = $P0.'buffer_type'()
@@ -380,7 +380,7 @@
pir_output_is( <<"CODE", <<'OUT', 'buffer_size' );
.sub 'test' :main
- \$P0 = new 'FileHandle'
+ \$P0 = new ['FileHandle']
\$P0.'buffer_type'('full-buffered')
\$P0.'buffer_size'(42)
@@ -401,7 +401,7 @@
\$P0.'print'(1234567890)
\$P0.'close'()
- \$P1 = new 'FileHandle'
+ \$P1 = new ['FileHandle']
\$P1.'open'('$temp_file')
\$S0 = \$P1.'readline'()
@@ -423,7 +423,7 @@
# L<PDD22/I\/O PMC API/=item encoding>
pir_output_is( <<'CODE', <<'OUT', 'encoding' );
.sub 'test' :main
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$P0.'encoding'('utf8')
$S0 = $P0.'encoding'()
@@ -441,7 +441,7 @@
pir_output_is( <<"CODE", <<'OUT', 'encoding - read/write' );
.sub 'test' :main
- \$P0 = new 'FileHandle'
+ \$P0 = new ['FileHandle']
\$P0.'encoding'('utf8')
\$P0.'open'('$temp_file', 'w')
@@ -452,7 +452,7 @@
\$P0.'print'(\$S0)
\$P0.'close'()
- \$P1 = new 'FileHandle'
+ \$P1 = new ['FileHandle']
\$P1.'encoding'('utf8')
\$P1.'open'('$temp_file')
@@ -485,7 +485,7 @@
# L<PDD22/I\/O PMC API/=item mode>
pir_output_is( <<'CODE', <<'OUT', 'mode' );
.sub 'test' :main
- $P0 = new 'FileHandle'
+ $P0 = new ['FileHandle']
$P0.'open'('README')
$S0 = $P0.'mode'()
@@ -510,11 +510,11 @@
line 3
EOS
.local pmc pio, pio2
- pio = new 'FileHandle'
+ pio = new ['FileHandle']
pio.'open'("$temp_file", "w")
pio.'print'(\$S0)
pio.'close'()
- pio2 = new 'FileHandle'
+ pio2 = new ['FileHandle']
\$S1 = pio2.'readall'('$temp_file')
if \$S0 == \$S1 goto ok
print "not "
@@ -533,12 +533,12 @@
line 3
EOS
.local pmc pio, pio2
- pio = new 'FileHandle'
+ pio = new ['FileHandle']
pio.'open'("$temp_file", "w")
pio.'print'(\$S0)
pio.'close'()
- pio2 = new 'FileHandle'
+ pio2 = new ['FileHandle']
pio2.'open'("$temp_file", "r")
\$S1 = pio2.'readall'()
if \$S0 == \$S1 goto ok
@@ -553,7 +553,7 @@
pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on closed filehandle" );
.sub 'main'
.local pmc ifh
- ifh = new 'FileHandle'
+ ifh = new ['FileHandle']
ifh.'encoding'('utf8')
\$S0 = ifh.'readall'('$temp_file')
@@ -570,7 +570,7 @@
pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on opened filehandle" );
.sub 'main'
.local pmc ifh
- ifh = new 'FileHandle'
+ ifh = new ['FileHandle']
ifh.'encoding'('utf8')
ifh.'open'('$temp_file')
Modified: trunk/t/pmc/fixedbooleanarray.t
==============================================================================
--- trunk/t/pmc/fixedbooleanarray.t (original)
+++ trunk/t/pmc/fixedbooleanarray.t Wed Jan 7 18:49:58 2009
@@ -24,7 +24,7 @@
=cut
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set I0,P0
eq I0,0,OK_1
@@ -44,7 +44,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and
getting an exception)" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set I0,P0
set P0,1
@@ -61,7 +61,7 @@
#VIM's syntax highlighter needs this line
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 1
set P0[0],-7
@@ -90,7 +90,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 2
set P0[1], -7
@@ -119,7 +119,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements"
);
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 1
set P0[1], -7
@@ -131,7 +131,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements"
);
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 1
set I0, P0[1]
@@ -143,9 +143,9 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 3
- new P1, 'Key'
+ new P1, ['Key']
set P1, 0
set P0[P1], 25
@@ -180,17 +180,17 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 1024
set P0[25], 125
set P0[128], 10.2
set P0[513], "17"
- new P1, 'Integer'
+ new P1, ['Integer']
set P1, 123456
set P0[1023], P1
- new P2, 'Key'
+ new P2, ['Key']
set P2, 25
set I0, P0[P2]
eq I0, 1, OK1
@@ -228,7 +228,7 @@
.sub _main
.local pmc pmc1
- pmc1 = new 'FixedBooleanArray'
+ pmc1 = new ['FixedBooleanArray']
.local int bool1
does bool1, pmc1, "scalar"
print bool1
@@ -248,7 +248,7 @@
OUTPUT
pasm_output_is( << 'CODE', << 'OUTPUT', "Truth" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
unless P0, OK1
print "not "
OK1: print "ok 1\n"
@@ -268,11 +268,11 @@
OUTPUT
pasm_output_is( << 'CODE', << 'OUTPUT', "PMC keys & values" );
- new P0, 'FixedBooleanArray'
+ new P0, ['FixedBooleanArray']
set P0, 2
- new P1, 'Key'
+ new P1, ['Key']
set P1, 1
- new P2, 'Integer'
+ new P2, ['Integer']
set P2, 1
set P0[P1], P2
set I0, P0[P1]
@@ -289,7 +289,7 @@
.local int i
.local string s
- fba = new 'FixedBooleanArray'
+ fba = new ['FixedBooleanArray']
fba = 17
fba[1] = 1
@@ -317,7 +317,7 @@
.local int i
.local string s
- fba1 = new 'FixedBooleanArray'
+ fba1 = new ['FixedBooleanArray']
fba1 = 17
fba1[1] = 1
Modified: trunk/t/pmc/fixedfloatarray.t
==============================================================================
--- trunk/t/pmc/fixedfloatarray.t (original)
+++ trunk/t/pmc/fixedfloatarray.t Wed Jan 7 18:49:58 2009
@@ -18,8 +18,8 @@
=cut
.sub main :main
- .include 'include/fp_equality.pasm'
- .include 'include/test_more.pir'
+ .include 'fp_equality.pasm'
+ .include 'test_more.pir'
plan(24)
array_size_tests()
@@ -32,7 +32,7 @@
.end
.sub array_size_tests
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $I0,$P0
is($I0, 0, "initial size is 0")
@@ -53,7 +53,7 @@
.sub element_set_tests
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, 1
set $P0[0],-7
@@ -68,7 +68,7 @@
set $S0,$P0[0]
is($S0, "17.2", "ok")
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, 2
set $P0[1], -7
@@ -86,7 +86,7 @@
.end
.sub oob_tests
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, 1
push_eh eh1
@@ -110,9 +110,9 @@
.sub set_and_get_tests
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, 3
- new $P1, 'Key'
+ $P1 = new ['Key']
set $P1, 0
set $P0[$P1], 25
@@ -136,17 +136,17 @@
is($S0, "17.32", "set string via PMC Key, get via int")
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, 1024
set $P0[25], 125
set $P0[128], 10.2
set $P0[513], "17.3"
- new $P1, 'Integer'
+ $P1 = new ['Integer']
set $P1, 123456
set $P0[1023], $P1
- new $P2, 'Key'
+ $P2 = new ['Key']
set $P2, 25
set $I0, $P0[$P2]
is($I0, 125, "set int via int, get via PMC Key")
@@ -173,7 +173,7 @@
.sub clone_tests
set $I30, 2000
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
set $P0, $I30
set $I0, 0
L1: set $N0, $I0
@@ -200,7 +200,7 @@
.sub what_is_truth
- new $P0, 'FixedFloatArray'
+ $P0 = new ['FixedFloatArray']
$I0 = $P0
is($I0, 0, "an empty FixedFloatArray is false")
set $P0, 1
@@ -211,7 +211,7 @@
.sub interface_check
.local pmc p
- p = new 'FixedFloatArray'
+ p = new ['FixedFloatArray']
.local int b
does b, p, "scalar"
is(b, 0, "FFA does not do scalar")
Modified: trunk/t/pmc/fixedintegerarray.t
==============================================================================
--- trunk/t/pmc/fixedintegerarray.t (original)
+++ trunk/t/pmc/fixedintegerarray.t Wed Jan 7 18:49:58 2009
@@ -24,7 +24,7 @@
=cut
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set I0,P0
eq I0,0,OK_1
@@ -44,7 +44,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and
getting an exception)" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set I0,P0
set P0,1
@@ -61,7 +61,7 @@
#VIM's syntax highlighter needs this line
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1
set P0[0],-7
@@ -90,7 +90,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 2
set P0[1], -7
@@ -119,7 +119,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements"
);
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1
set P0[1], -7
@@ -131,7 +131,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements"
);
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1
set I0, P0[1]
@@ -142,7 +142,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements,
I" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1
set I1, 1
set I0, P0[I1]
@@ -153,7 +153,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements,
-I" );
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1
set I1, -1
set I0, P0[I1]
@@ -165,9 +165,9 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 3
- new P1, 'Key'
+ new P1, ['Key']
set P1, 0
set P0[P1], 25
@@ -202,17 +202,17 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedIntegerArray'
+ new P0, ['FixedIntegerArray']
set P0, 1024
set P0[25], 125
set P0[128], 10.2
set P0[513], "17"
- new P1, 'Integer'
+ new P1, ['Integer']
set P1, 123456
set P0[1023], P1
- new P2, 'Key'
+ new P2, ['Key']
set P2, 25
set I0, P0[P2]
eq I0, 125, OK1
@@ -250,7 +250,7 @@
.sub _main
.local pmc pmc1
- pmc1 = new 'FixedIntegerArray'
+ pmc1 = new ['FixedIntegerArray']
.local int bool1
does bool1, pmc1, "scalar"
print bool1
Modified: trunk/t/pmc/fixedpmcarray.t
==============================================================================
--- trunk/t/pmc/fixedpmcarray.t (original)
+++ trunk/t/pmc/fixedpmcarray.t Wed Jan 7 18:49:58 2009
@@ -24,7 +24,7 @@
=cut
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
- new P0,'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set I0,P0
eq I0,0,OK_1
@@ -44,7 +44,7 @@
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and
getting an exception)" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set I0,P0
set P0,1
@@ -61,7 +61,7 @@
#VIM's syntax highlighter needs this line
pasm_output_is( <<'CODE', <<'OUTPUT', "Truth and falsehood" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 0
if P0, NOK_1
@@ -90,7 +90,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1
set P0[0],-7
@@ -119,7 +119,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 2
set P0[1], -7
@@ -148,7 +148,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting negatively indexed elements" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1
push_eh caught
@@ -164,7 +164,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Getting negatively indexed elements" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1
push_eh caught
@@ -181,7 +181,7 @@
pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1
push_eh caught
@@ -197,7 +197,7 @@
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1
push_eh caught
@@ -214,9 +214,9 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 3
- new P1, 'Key'
+ new P1, ['Key']
set P1, 0
set P0[P1], 25
@@ -251,17 +251,17 @@
pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
.include 'include/fp_equality.pasm'
- new P0, 'FixedPMCArray'
+ new P0, ['FixedPMCArray']
set P0, 1024
set P0[25], 125
set P0[128], 10.2
set P0[513], "cow"
- new P1, 'Integer'
+ new P1, ['Integer']
set P1, 123456
set P0[1023], P1
- new P2, 'Key'
+ new P2, ['Key']
set P2, 25
set I0, P0[P2]
eq I0, 125, OK1
@@ -302,7 +302,7 @@
.local pmc compares, cmp_fun
# RT #46855 doesnt work wit prederef of JIT
bounds 1
- compares = new 'Integer'
+ compares = new ['Integer']
compares = 0
set_global "compares", compares
cmp_fun = get_global "cmp_fun"
@@ -315,7 +315,7 @@
compares = get_global "compares"
compares = 0
.local pmc ar
- new ar, 'FixedPMCArray'
+ ar = new ['FixedPMCArray']
ar = 5
ar[0] = 10
ar[1] = 2
@@ -365,7 +365,7 @@
.sub _main
.local pmc pmc1
- pmc1 = new 'FixedPMCArray'
+ pmc1 = new ['FixedPMCArray']
.local int bool1
does bool1, pmc1, "scalar"
print bool1
@@ -388,7 +388,7 @@
.sub main :main
.local pmc arr1
- arr1 = new 'FixedPMCArray'
+ arr1 = new ['FixedPMCArray']
arr1 = 2005
.local pmc elem_1956
elem_1956 = arr1[1956]
@@ -410,14 +410,14 @@
.local num elem_out_num
.local string elem_out_string
- matrix = new 'FixedPMCArray'
+ matrix = new ['FixedPMCArray']
matrix = 1
- row = new 'FixedPMCArray'
+ row = new ['FixedPMCArray']
row = 4 # assing with an integer, number, pmc, string
matrix[0] = row
matrix[0;0] = 128
matrix[0;1] = 128.128
- elem_in_pmc = new 'Integer'
+ elem_in_pmc = new ['Integer']
elem_in_pmc = 256
matrix[0;2] = elem_in_pmc
matrix[0;3] = "asdf"
@@ -520,8 +520,8 @@
.sub main :main
.local pmc fpa1, fpa2, p1, p2
.local int i
- fpa1 = new 'FixedPMCArray'
- fpa2 = new 'FixedPMCArray'
+ fpa1 = new ['FixedPMCArray']
+ fpa2 = new ['FixedPMCArray']
print "1:"
if fpa1 == fpa2 goto L1
@@ -536,9 +536,9 @@
fpa2 = 3
- p1 = new 'String'
+ p1 = new ['String']
p1 = "foobarx"
- p2 = new 'String'
+ p2 = new ['String']
p2 = "foobarx"
fpa1[0] = p1
@@ -549,8 +549,8 @@
print "not "
L3: say "equal"
- p1 = new 'String'
- p2 = new 'String'
+ p1 = new ['String']
+ p2 = new ['String']
p1 = ''
p2 = ''
@@ -580,7 +580,7 @@
pir_output_is( <<'CODE', <<'OUTPUT', "defined" );
.sub main :main
.local pmc arr1
- arr1 = new 'FixedPMCArray'
+ arr1 = new ['FixedPMCArray']
arr1 = 2005
.local int defined_elem_1956
defined_elem_1956 = defined arr1[1956]
@@ -604,7 +604,7 @@
.local pmc arr1
.local int elems_i
.local num elems_f
- arr1 = new 'FixedPMCArray'
+ arr1 = new ['FixedPMCArray']
arr1 = 0
elems_i = elements arr1
if elems_i == 0 goto ok_1
@@ -624,7 +624,7 @@
ok_3:
say 'ok 3'
- arr1 = new 'FixedPMCArray'
+ arr1 = new ['FixedPMCArray']
arr1 = 2048
elems_i = elements arr1
if elems_i == 2048 goto ok_4
@@ -656,25 +656,25 @@
pir_output_is(<<'CODE', <<'OUTPUT', 'basic splice');
.sub 'main'
.local pmc one
- one = new 'Integer'
+ one = new ['Integer']
one = 1
.local pmc fpa
- fpa = new 'FixedPMCArray'
+ fpa = new ['FixedPMCArray']
fpa = 5
splice fpa, one, 0, 5
print_array( fpa )
.local pmc two
- two = new 'Integer'
+ two = new ['Integer']
two = 2
splice fpa, two, 1, 3
print_array( fpa )
.local pmc three
- three = new 'Integer'
+ three = new ['Integer']
three = 3
splice fpa, three, 2, 3
@@ -704,11 +704,11 @@
pir_error_output_like(<<'CODE', <<'OUTPUT', 'splice out of bounds, offset 0');
.sub 'main'
.local pmc fpa
- fpa = new 'FixedPMCArray'
+ fpa = new ['FixedPMCArray']
fpa = 5
.local pmc nil
- nil = new 'Undef'
+ nil = new ['Undef']
splice fpa, nil, 0, 6
.end
@@ -719,11 +719,11 @@
pir_error_output_like(<<'CODE', <<'OUTPUT', 'splice out of bounds, big
offset');
.sub 'main'
.local pmc fpa
- fpa = new 'FixedPMCArray'
+ fpa = new ['FixedPMCArray']
fpa = 5
.local pmc nil
- nil = new 'Undef'
+ nil = new ['Undef']
splice fpa, nil, 6, 0
.end