Skip to content

Commit

Permalink
[t/spec] more smartlinks; simplified subrule.t a bit
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@27842 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Aug 2, 2009
1 parent cd74518 commit 26cb83b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 9 additions & 12 deletions S05-capture/subrule.t
Expand Up @@ -14,30 +14,26 @@ be valid perl6.

plan 31;

if !eval('("a" ~~ /a/)') {
skip_rest "skipped tests - rules support appears to be missing";
exit;
}
# L<S05/Match objects/When used as a hash>

regex abc {abc}


regex once {<.abc>}

ok("abcabcabcabcd" ~~ m/<.once>/, 'Once match');
ok($/, 'Once matched');
is(~$/, "abc", 'Once matched');
ok(@$/ == 0, 'Once no array capture');
ok(%$/.keys == 0, 'Once no hash capture');
ok(@($/) == 0, 'Once no array capture');
ok(%($/).keys == 0, 'Once no hash capture');


regex rep {<.abc>**{4}}

ok("abcabcabcabcd" ~~ m/<.rep>/, 'Rep match');
ok($/, 'Rep matched');
is(~$/, "abcabcabcabc", 'Rep matched');
ok(@$/ == 0, 'Rep no array capture');
ok(%$/.keys == 0, 'Rep no hash capture');
ok(@($/) == 0, 'Rep no array capture');
ok(%($/).keys == 0, 'Rep no hash capture');


regex cap {<abc>}
Expand All @@ -48,8 +44,8 @@ is(~$/, "abc", 'Cap zero matched');
is(~$/<cap>, "abc", 'Cap captured');

is(~$/<cap><abc>, "abc", 'Cap abc captured');
ok(@$/ == 0, 'Cap no array capture');
ok(%$/.keys == 1, 'Cap hash capture');
ok(@($/) == 0, 'Cap no array capture');
ok(%($/).keys == 1, 'Cap hash capture');

regex repcap {<abc>**{4}}

Expand All @@ -61,7 +57,7 @@ is(~$/<repcap><abc>[0], "abc", 'Repcap abc zero captured');
is(~$/<repcap><abc>[1], "abc", 'Repcap abc one captured');
is(~$/<repcap><abc>[2], "abc", 'Repcap abc two captured');
is(~$/<repcap><abc>[3], "abc", 'Repcap abc three captured');
ok(@$/ == 0, 'Repcap no array capture');
ok(@($/) == 0, 'Repcap no array capture');


regex caprep {(<.abc>**{4})}
Expand All @@ -72,3 +68,4 @@ is(~$/, "abcabcabcabc", 'Caprep matched');
is(~$/<caprep>, "abcabcabcabc", 'Caprep captured');
is(~$/<caprep>[0], "abcabcabcabc", 'Caprep abc one captured');

# vim: ft=perl6
2 changes: 2 additions & 0 deletions S05-modifier/sameaccent.t
Expand Up @@ -6,6 +6,8 @@ plan 8;
Testing the C<:aa> or C<:sameaccent> modifier - as always, need more tests
# L<S05/Modifiers/:sameaccent>
=end description

#?pugs 999 skip feature
Expand Down

0 comments on commit 26cb83b

Please sign in to comment.