fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / t / compilers / pge / 02-match.t
blobb0cda4dad7d8c0961473c982cbf29577c54b9400
1 #!./parrot
2 # Copyright (C) 2006-2010, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/compilers/pge/02-match.t - test the Match class
10 =head1 SYNOPSIS
12         % prove t/compilers/pge/02-match.t
14 =head1 DESCRIPTION
16 Tests the Match class directly.
18 =cut
20 .sub main :main
21     .include 'test_more.pir'
22     plan(4)
24     test_concat_on_a_match_object()
25     test_push_on_a_match_object()
26 .end
28 .sub test_concat_on_a_match_object
29     load_bytecode 'PGE.pbc'
31     $P0 = compreg 'PGE::Perl6Regex'
32     $P1 = $P0('.+')
33     $P2 = $P1('world')
35     is($P2, 'world', 'concat on a Match object (rt#39135)')
37     $P3 = new 'String'
38     $P3 = 'hello '
40     $P4 = concat $P3, $P2
41     is($P4, 'hello world', 'concat on a Match object (rt#39135)')
42 .end
44 .sub test_push_on_a_match_object
45     .local pmc match, str, arr
46     load_bytecode 'PGE.pbc'
47     match = new ['PGE';'Match']
48     str = new 'String'
49     str = 'foo'
50     push match, str
51     arr = match.'list'()
52     $I0 = elements arr
53     is($I0, 1, 'push on a Match object')
54     $P3 = match[0]
55     is($P3, 'foo', 'push on a Match object')
56 .end
58 # Local Variables:
59 #   mode: pir
60 #   fill-column: 100
61 # End:
62 # vim: expandtab shiftwidth=4 ft=pir: