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 309defc commit ba20490Copy full SHA for ba20490
S05-capture/match-object.t
@@ -0,0 +1,21 @@
1
+use v6;
2
+use Test;
3
+
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 12;
8
9
+ok 'ab12de' ~~ /\d+/, 'match successful';
10
+is $/.WHAT.gist, Match.gist, 'got right type';
11
+ok $/.Bool, '.Bool';
12
+ok $/.defined, '.defined';
13
+is $/.Str, '12', '.Str';
14
+is $/.from, 2, '.from';
15
+is $/.to, 4, '.to';
16
+is $/.prematch, 'ab', '.prematch';
17
+is $/.postmatch, 'de', '.postmatch';
18
19
+nok 'abde' ~~ /\d/, 'no match';
20
+nok $/.Bool, 'failed match is False';
21
+is $/.Str, '', 'false match stringifies to empty string';
0 commit comments