Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
a little testing of conjunctive regex captures (&&)
  • Loading branch information
dwarring committed Aug 26, 2013
1 parent a6a46c3 commit 9442ea7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S05-capture/caps.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 30;
plan 36;

# L<S05/Match objects/"$/.caps">

Expand Down Expand Up @@ -62,6 +62,18 @@ ok 'a;b,c,' ~~ m/(<.alpha>) +%% (<.punct>)/, 'Regex matches';
is ca($/.caps), '0:a|1:;|0:b|1:,|0:c|1:,', '.caps on %% separator';
is ca($/.chunks), '0:a|1:;|0:b|1:,|0:c|1:,', '.chunks on %% separator';

#?niezca skip 'conjunctive regex terms - nyi'
{
ok 'a' ~~ m/a && <alpha>/, 'Regex matches';
is ca($/.caps), 'alpha:a', 'conjunctive capture lhs';
ok 'a' ~~ m/<alpha> && a/, 'Regex matches';
is ca($/.caps), 'alpha:a', 'conjunctive capture rhs';

ok 'ab' ~~ m/[[a|b] && <alpha> ]**1..2/, 'Regex matches';
#?rakudo todo 'RT117995 - quantified conjunctive capture'
is ca($/.caps), 'alpha:a|alpha:b', 'quantified conjunctive capture';
}

done;

# vim: ft=perl6

0 comments on commit 9442ea7

Please sign in to comment.