Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 157 lines (136 sloc) 4.638 kb
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
1 use v6;
db4bde79 »
2010-03-13 [t/spec] add 'use MONKEY_TYPING' where appropriate
2 use MONKEY_TYPING;
3
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
4 use Test;
b54c6476 »
2009-10-26 [t/spec] Tests for RT #70007
5 BEGIN { @*INC.push('t/spec/packages/') };
6 use Test::Util;
606e7375 »
2012-07-15 alphabetic characters can follow digits in $0 variable in interpolation
7 plan 38;
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
8
f33600ba »
2009-04-29 smartlink updates
9 # old: L<S05/Return values from matches/"A match always returns a Match object" >
10 # L<S05/Match objects/"A match always returns a " >
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
11 {
12 my $match = 'abd' ~~ m/ (a) (b) c || (\w) b d /;
7176c48c »
2012-01-17 niecza (auto)unfudge
13 #?niecza todo 'match returns match object'
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
14 isa_ok( $match, 'Match', 'Match object returned');
7176c48c »
2012-01-17 niecza (auto)unfudge
15 #?niecza todo 'match returns match object'
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
16 isa_ok( $/, 'Match', 'Match object assigned to $/');
17 ok( $/ === $match, 'Same match objects');
18 }
19
f33600ba »
2009-04-29 smartlink updates
20 # old: L<S05/Return values from matches/"The array elements of a C<Match> object are referred to" >
21 # L<S05/Accessing captured subpatterns/"The array elements of a " >
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
22 {
23 'abd' ~~ m/ (a) (b) c || (\w) b d /;
24 ok( $/[0] eq 'a', 'positional capture accessible');
25 ok( @($/).[0] eq 'a', 'array context - correct number of positional captures');
26 ok( @($/).elems == 1, 'array context - correct number of positional captures');
3d2c0c90 »
2009-04-20 added tests for $/.list and $/.hash
27 ok( $/.list.elems == 1, 'the .list methods returns a list object');
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
28 }
29
f33600ba »
2009-04-29 smartlink updates
30 # old: L<S05/Return values from matches/"When used as a hash, a C<Match> object" >
31 # L<S05/Match objects/"When used as a hash" >
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
32 {
33 'abd' ~~ m/ <alpha> <alpha> c || <alpha> b d /;
34 ok( $/<alpha> eq 'a', 'named capture accessible');
35 ok( %($/).keys == 1, 'hash context - correct number of named captures');
36 ok( %($/).<alpha> eq 'a', 'hash context - named capture accessible');
3d2c0c90 »
2009-04-20 added tests for $/.list and $/.hash
37 ok( $/.hash.keys[0] eq 'alpha', 'the .hash method returns a hash object');
fd56de2e »
2009-01-01 [t/spec]: S05 - Moved some capturing tests and added a few
38 }
65a16232 »
2009-04-27 add test for accessing match keys through scalary copy RT 62530
39
40 # RT 62530
95ea9151 »
2009-05-10 [t/spec] remove rest of "is also" on classes
41 #?rakudo skip 'augment'
06bb9940 »
2012-01-16 fudge for niecza
42 #?niecza skip 'rule declaration outside of grammar'
65a16232 »
2009-04-27 add test for accessing match keys through scalary copy RT 62530
43 {
95ea9151 »
2009-05-10 [t/spec] remove rest of "is also" on classes
44 augment class Match { method keys () {return %(self).keys }; };
65a16232 »
2009-04-27 add test for accessing match keys through scalary copy RT 62530
45 rule a {H};
46 "Hello" ~~ /<a>/;
47 is $/.keys, 'a', 'get rule result';
48 my $x = $/;
49 is $x.keys, 'a', 'match copy should be same as match';
50 }
95ea9151 »
2009-05-10 [t/spec] remove rest of "is also" on classes
51
404d496d »
2009-08-12 [t/spec] Test for RT #64946
52 # RT #64946
53 {
f824933b »
2010-05-29 [t/spec] fudge capturing-contexts.t for Rakudo
54 my regex o { o };
55 "foo" ~~ /f<o=&o>+/;
404d496d »
2009-08-12 [t/spec] Test for RT #64946
56
57 is ~$<o>, 'o o', 'match list stringifies like a normal list';
6fba9029 »
2011-09-30 add a test for RT #65308; fudge capturing-contexts.t for rakudo
58 ok $<o> ~~ Positional, '... and it is Positional';
404d496d »
2009-08-12 [t/spec] Test for RT #64946
59 # I don't know what difference 'isa' makes, but it does.
60 # Note that calling .WHAT (as in the original ticket) does not have
61 # the same effect.
62 is ~$<o>, 'o o', 'match list stringifies like a normal list AFTER "isa"';
63 }
64
c96e63b8 »
2009-08-12 [t/spec] Tests for RT #64952
65 # RT #64952
66 {
67 'ab' ~~ /(.)+/;
68 is $/[0][0], 'a', 'match element [0][0] from /(.)+/';
69 is $/[0][1], 'b', 'match element [0][1] from /(.)+/';
70
71 my @match = @( 'ab' ~~ /(.)+/ );
6fba9029 »
2011-09-30 add a test for RT #65308; fudge capturing-contexts.t for rakudo
72 #?rakudo 2 todo 'nom regression'
c96e63b8 »
2009-08-12 [t/spec] Tests for RT #64952
73 is @match[0][0], 'a', 'match element [0][0] from /(.)+/ coerced';
74 is @match[0][1], 'b', 'match element [0][1] from /(.)+/ coerced';
75 }
76
34fb50f6 »
2009-08-13 [t/spec] feeble test for RT #64948
77 # RT #64948
78 {
890bc5fd »
2011-10-10 rakudo fudging
79 ok %( 'foo' ~~ /<alpha> oo/ ).exists('alpha'),
34fb50f6 »
2009-08-13 [t/spec] feeble test for RT #64948
80 'Match coerced to Hash says match exists';
81 }
82
874939bb »
2009-10-28 [t/spec/TODO] See r28888 for tests for r28881 and note similar tests
83 # This is similar to a test in S05-interpolation/regex-in-variable.t
06bb9940 »
2012-01-16 fudge for niecza
84 #?niecza todo 'match with non-existent capture does not match'
b54c6476 »
2009-10-26 [t/spec] Tests for RT #70007
85 nok 'aa' ~~ /(.)$1/, 'match with non-existent capture does not match';
86 #?rakudo todo 'RT 70007'
06bb9940 »
2012-01-16 fudge for niecza
87 #?niecza todo 'eek'
b54c6476 »
2009-10-26 [t/spec] Tests for RT #70007
88 is_run( q{'aa' ~~ /(.)$1/},
89 {
90 status => 0,
91 out => '',
874939bb »
2009-10-28 [t/spec/TODO] See r28888 for tests for r28881 and note similar tests
92 err => rx/undef/,
b54c6476 »
2009-10-26 [t/spec] Tests for RT #70007
93 },
94 'match with non-existent capture emits a warning' );
95
08653098 »
2009-11-04 [t/spec] Test for RT 66252: match in void context does not set $/
96 # RT #66252
97 {
98 $_ = 'RT 66252';
5ac6379b »
2011-02-23 correct and unfudge tests for RT #66252
99 m/(R.)/;
06bb9940 »
2012-01-16 fudge for niecza
100 #?niecza todo 'Match object in $/ after match in void context'
08653098 »
2009-11-04 [t/spec] Test for RT 66252: match in void context does not set $/
101 isa_ok $/, 'Match', 'Match object in $/ after match in void context';
102 is $/, 'RT', 'Matched as intended in void context';
103 }
104
533512a6 »
2009-11-14 [t/spec] Test for RT 70003: $/.orig produces CodeString
105 # RT #70003
106 {
01db9ceb »
2011-10-01 correct and unfudge tests for RT #70003
107 'abc' ~~ /a/;
108 is ($/.orig).rindex('a'), 0, 'rindex() works on $/.orig';
109 is ($/.orig).rindex('a', 2), 0, 'rindex() works on $/.orig';
533512a6 »
2009-11-14 [t/spec] Test for RT 70003: $/.orig produces CodeString
110 }
111
046b183e »
2010-08-19 [t/spec] tests for RT #71362, $0, $1 etc. work even for $/ := $something
112 # RT #71362
6fba9029 »
2011-09-30 add a test for RT #65308; fudge capturing-contexts.t for rakudo
113 #?rakudo skip 'binding to $/'
046b183e »
2010-08-19 [t/spec] tests for RT #71362, $0, $1 etc. work even for $/ := $something
114 {
115 $/ := 'foobar';
116 is $0, 'foobar', '$0 works like $/[0], even for non-Match objects';
117 nok $1.defined, '$1 is not defined';
118 }
119
f1ff19af »
2010-08-11 [t/spec] tests for # RT #72956 $0 when $/ is undefined causes Rakudo …
120 # RT #72956
06bb9940 »
2012-01-16 fudge for niecza
121 #?niecza skip 'Unsupported use of $/ variable as input record separator'
f1ff19af »
2010-08-11 [t/spec] tests for # RT #72956 $0 when $/ is undefined causes Rakudo …
122 {
123 $/ = Any;
124 lives_ok { $0 },
125 '$0 accessible when $/ is undefined';
b5caf94f »
2010-08-12 [t/spec] tests for RT #RT #77160, flattening of quantified captures i…
126 ok $0 === Any,
f1ff19af »
2010-08-11 [t/spec] tests for # RT #72956 $0 when $/ is undefined causes Rakudo …
127 '$0 is Any when $/ is undefined';
816c95f5 »
2010-08-12 [t/spec] be even more explicit with undefinedness check
128 nok $0.defined, '$0 is undefined';
f1ff19af »
2010-08-11 [t/spec] tests for # RT #72956 $0 when $/ is undefined causes Rakudo …
129 }
130
b5caf94f »
2010-08-12 [t/spec] tests for RT #RT #77160, flattening of quantified captures i…
131 # RT #77160
132 {
133 ok 'abc' ~~ /(.)+/, 'regex sanity';
134 my $x = 0;
135 $x++ for $/.list;
6fba9029 »
2011-09-30 add a test for RT #65308; fudge capturing-contexts.t for rakudo
136 #?rakudo todo 'nom regression'
b5caf94f »
2010-08-12 [t/spec] tests for RT #RT #77160, flattening of quantified captures i…
137 is $x, 1, '$/.list does not flatten quantified subcaptures';
138
139 ok 'abc' ~~ /(.)**2 (.)/, 'regex sanity';
140 $x = 0;
141 $x++ for $/.list;
6fba9029 »
2011-09-30 add a test for RT #65308; fudge capturing-contexts.t for rakudo
142 #?rakudo todo 'nom regression'
b5caf94f »
2010-08-12 [t/spec] tests for RT #RT #77160, flattening of quantified captures i…
143 is $x, 2, '$/.list does not flattens subcaptures';
144 }
145
606e7375 »
2012-07-15 alphabetic characters can follow digits in $0 variable in interpolation
146 # RT 74180
147 {
148 my $s;
149 try { $s = eval '"foo" ~~ /(foo)/; "$0a"' };
150 ok not $!, 'alphabetic characters can follow digits in $0 variable in interpolation';
151 is $s, 'fooa', 'alphabetic characters follows $0 interpolated value';
152 }
153
e76dd4c7 »
2010-12-31 s/done_testing/done/ as per recent S24 changes
154 done;
b54c6476 »
2009-10-26 [t/spec] Tests for RT #70007
155
95ea9151 »
2009-05-10 [t/spec] remove rest of "is also" on classes
156 # vim: ft=perl6
Something went wrong with that request. Please try again.