We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6b125e commit 7530a15Copy full SHA for 7530a15
S05-capture/match-object.t
@@ -4,7 +4,7 @@ use Test;
4
# this file should become the test for systematically testing
5
# Match objects. Exception: .caps and .chunks are tested in caps.t
6
7
-plan 31;
+plan 35;
8
9
ok 'ab12de' ~~ /\d+/, 'match successful';
10
is $/.WHAT, Match.WHAT, 'got right type';
@@ -22,6 +22,15 @@ is $/.values.elems, 0, '.values (empty)';
22
is $/.pairs.elems, 0, '.pairs (empty)';
23
is $/.kv.elems, 0, '.kv (empty)';
24
25
+
26
+# prematch and postmatch for zero-width matches,
27
+# which was broken in rakudo until https://github.com/rakudo/rakudo/commit/c04b8b5cc9
28
29
+ok 'abc def' ~~ />>/, 'sanity 1';
30
+is $/.from, 3, 'sanity 2';
31
+is $/.prematch, 'abc', '.prematch for zero-width matches';
32
+is $/.postmatch, ' def', '.postmatch for zero-width matches';
33
34
nok 'abde' ~~ /\d/, 'no match';
35
nok $/.Bool, 'failed match is False';
36
is $/.Str, '', 'false match stringifies to empty string';
0 commit comments