Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 129 lines (120 sloc) 8.336 kB
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
1 use v6;
2
3 use Test;
4
5 plan 103;
6
7 #L<S05/Modifiers/"The extended syntax">
8
9 unless "a" ~~ rx:P5/a/ {
cf81ec2 @coke kebab case skip-rest
coke authored
10 skip-rest "skipped tests - P5 regex support appears to be missing";
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
11 exit;
12 }
13
f952080 [t/spec]: more rakudo :P5 fudging
pmichaud authored
14 # force_todo(73..75); # PCRE hard parsefails
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
15
16 my $b = 'x';
17 my $backspace = "\b";
18 my $bang = '!';
19
20 ok((not ("abb\nb\n" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1049 (1253)');
21 ok((not ("abb\nb\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1050 (1254)');
22 is(("abb\nb\n" ~~ rx:P5/(?m)abb$/ && $/.from), 0, 're_tests 1051/0 (1255)');
23 is(("b\nabb\n" ~~ rx:P5/(?m)abb\Z/ && $/.from), 2, 're_tests 1052/0 (1256)');
24 ok((not ("b\nabb\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1053 (1257)');
25 is(("b\nabb\n" ~~ rx:P5/(?m)abb$/ && $/.from), 2, 're_tests 1054/0 (1258)');
26 is(("b\nabb" ~~ rx:P5/(?m)abb\Z/ && $/.from), 2, 're_tests 1055/0 (1259)');
27 is(("b\nabb" ~~ rx:P5/(?m)abb\z/ && $/.from), 2, 're_tests 1056/0 (1260)');
28 is(("b\nabb" ~~ rx:P5/(?m)abb$/ && $/.from), 2, 're_tests 1057/0 (1261)');
29 ok((not ("ac\nb\n" ~~ rx:P5/abb\Z/)), 're_tests 1058 (1262)');
30 ok((not ("ac\nb\n" ~~ rx:P5/abb\z/)), 're_tests 1060 (1264)');
31 ok((not ("ac\nb\n" ~~ rx:P5/abb$/)), 're_tests 1062 (1266)');
32 ok((not ("b\nac\n" ~~ rx:P5/abb\Z/)), 're_tests 1063 (1267)');
33 ok((not ("b\nac\n" ~~ rx:P5/abb\z/)), 're_tests 1065 (1269)');
34 ok((not ("b\nac\n" ~~ rx:P5/abb$/)), 're_tests 1067 (1271)');
35 ok((not ("b\nac" ~~ rx:P5/abb\Z/)), 're_tests 1068 (1272)');
36 ok((not ("b\nac" ~~ rx:P5/abb\z/)), 're_tests 1070 (1274)');
37 ok((not ("b\nac" ~~ rx:P5/abb$/)), 're_tests 1072 (1276)');
38 ok((not ("ac\nb\n" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1073 (1277)');
39 ok((not ("ac\nb\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1074 (1278)');
40 ok((not ("ac\nb\n" ~~ rx:P5/(?m)abb$/)), 're_tests 1075 (1279)');
41 ok((not ("b\nac\n" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1076 (1280)');
42 ok((not ("b\nac\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1077 (1281)');
43 ok((not ("b\nac\n" ~~ rx:P5/(?m)abb$/)), 're_tests 1078 (1282)');
44 ok((not ("b\nac" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1079 (1283)');
45 ok((not ("b\nac" ~~ rx:P5/(?m)abb\z/)), 're_tests 1080 (1284)');
46 ok((not ("b\nac" ~~ rx:P5/(?m)abb$/)), 're_tests 1081 (1285)');
47 ok((not ("ca\nb\n" ~~ rx:P5/abb\Z/)), 're_tests 1082 (1286)');
48 ok((not ("ca\nb\n" ~~ rx:P5/abb\z/)), 're_tests 1084 (1288)');
49 ok((not ("ca\nb\n" ~~ rx:P5/abb$/)), 're_tests 1086 (1290)');
50 ok((not ("b\nca\n" ~~ rx:P5/abb\Z/)), 're_tests 1087 (1291)');
51 ok((not ("b\nca\n" ~~ rx:P5/abb\z/)), 're_tests 1089 (1293)');
52 ok((not ("b\nca\n" ~~ rx:P5/abb$/)), 're_tests 1091 (1295)');
53 ok((not ("b\nca" ~~ rx:P5/abb\Z/)), 're_tests 1092 (1296)');
54 ok((not ("b\nca" ~~ rx:P5/abb\z/)), 're_tests 1094 (1298)');
55 ok((not ("b\nca" ~~ rx:P5/abb$/)), 're_tests 1096 (1300)');
56 ok((not ("ca\nb\n" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1097 (1301)');
57 ok((not ("ca\nb\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1098 (1302)');
58 ok((not ("ca\nb\n" ~~ rx:P5/(?m)abb$/)), 're_tests 1099 (1303)');
59 ok((not ("b\nca\n" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1100 (1304)');
60 ok((not ("b\nca\n" ~~ rx:P5/(?m)abb\z/)), 're_tests 1101 (1305)');
61 ok((not ("b\nca\n" ~~ rx:P5/(?m)abb$/)), 're_tests 1102 (1306)');
62 ok((not ("b\nca" ~~ rx:P5/(?m)abb\Z/)), 're_tests 1103 (1307)');
63 ok((not ("b\nca" ~~ rx:P5/(?m)abb\z/)), 're_tests 1104 (1308)');
64 ok((not ("b\nca" ~~ rx:P5/(?m)abb$/)), 're_tests 1105 (1309)');
65 is(("ca" ~~ rx:P5/(^|x)(c)/ && $1), "c", 're_tests 1106/2 (1310)');
66 ok((not ("x" ~~ rx:P5/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/)), 're_tests 1108 (1312)');
9c40515 @dnmfarrell fixed appended RT number to be within quoted string
dnmfarrell authored
67 #?rakudo todo '(?>...) NYI RT #125032'
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
68 is(("_I(round(xs * sz),1)" ~~ rx:P5/round\(((?>[^()]+))\)/ && $0), "xs * sz", 're_tests 1110/1 (1314)');
69 ok(("foo.bart" ~~ rx:P5/foo.bart/), 're_tests 1112 (1316)');
70 ok(("abcd\ndxxx" ~~ rx:P5/(?m)^d[x][x][x]/), 're_tests 1114 (1318)');
9c40515 @dnmfarrell fixed appended RT number to be within quoted string
dnmfarrell authored
71 #?rakudo 18 skip 'expensive quantifier RT #125033'
f952080 [t/spec]: more rakudo :P5 fudging
pmichaud authored
72 ok(("bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+X/), 're_tests 1115 (1319)');
73 ok(("bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+XX/), 're_tests 1117 (1321)');
74 ok(("bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.XX(.+)+X/), 're_tests 1119 (1323)');
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
75 ok((not ("bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+X/)), 're_tests 1121 (1325)');
76 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+XX/)), 're_tests 1123 (1327)');
77 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.XX(.+)+X/)), 're_tests 1125 (1329)');
b6e5936 [t/spec] Change more Pugs todo flags to fudge commands
kyle authored
78 ok(("bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+[X]/), 're_tests 1127 (1331)');
79 ok(("bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+[X][X]/), 're_tests 1129 (1333)');
80 ok(("bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.XX(.+)+[X]/), 're_tests 1131 (1335)');
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
81 ok((not ("bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+[X]/)), 're_tests 1133 (1337)');
82 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+[X][X]/)), 're_tests 1135 (1339)');
83 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.XX(.+)+[X]/)), 're_tests 1137 (1341)');
b6e5936 [t/spec] Change more Pugs todo flags to fudge commands
kyle authored
84 ok(("bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X](.+)+[X]/), 're_tests 1139 (1343)');
85 ok(("bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X](.+)+[X][X]/), 're_tests 1141 (1345)');
86 ok(("bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X][X](.+)+[X]/), 're_tests 1143 (1347)');
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
87 ok((not ("bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X](.+)+[X]/)), 're_tests 1145 (1349)');
88 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X](.+)+[X][X]/)), 're_tests 1147 (1351)');
89 ok((not ("bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.[X][X](.+)+[X]/)), 're_tests 1149 (1353)');
90 ok(("xxxtt" ~~ rx:P5/tt+$/), 're_tests 1151 (1355)');
9c40515 @dnmfarrell fixed appended RT number to be within quoted string
dnmfarrell authored
91 #?rakudo 6 skip 'character classes in enumerated range RT #125034'
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
92 is(("za-9z" ~~ rx:P5/([a-\d]+)/ && $0), "a-9", 're_tests 1153/1 (1357)');
93 is(("a0-za" ~~ rx:P5/([\d-z]+)/ && $0), "0-z", 're_tests 1155/1 (1359)');
94 is(("a0- z" ~~ rx:P5/([\d-\s]+)/ && $0), "0- ", 're_tests 1157/1 (1361)');
239bf2f @coke fudge for pugs
coke authored
95 is(("za-9z" ~~ rx:P5/([a-[:digit:]]+)/ && $0), "a-9", 're_tests 1159/1 (1363)');
96 is(("=0-z=" ~~ rx:P5/([[:digit:]-z]+)/ && $0), "0-z", 're_tests 1160/1 (1364)');
97 is(("=0-z=" ~~ rx:P5/([[:digit:]-[:alpha:]]+)/ && $0), "0-z", 're_tests 1161/1 (1365)');
9c40515 @dnmfarrell fixed appended RT number to be within quoted string
dnmfarrell authored
98 #?rakudo skip '\G RT #125035'
808f7c2 [t/spec] S05 - Moved P5/Perl5 modifier tests into spec (rakudo can't …
unobe authored
99 ok((not ("aaaXbX" ~~ rx:P5/\GX.*X/)), 're_tests 1162 (1366)');
100 is(("3.1415926" ~~ rx:P5/(\d+\.\d+)/ && $0), "3.1415926", 're_tests 1163/1 (1367)');
101 is(("have a web browser" ~~ rx:P5/(\ba.{0,10}br)/ && $0), "a web br", 're_tests 1165/1 (1369)');
102 ok((not ("Changes" ~~ rx:P5/(?i)\.c(pp|xx|c)?$/)), 're_tests 1167 (1371)');
103 ok(("IO.c" ~~ rx:P5/(?i)\.c(pp|xx|c)?$/), 're_tests 1169 (1373)');
104 is(("IO.c" ~~ rx:P5/(?i)(\.c(pp|xx|c)?$)/ && $0), ".c", 're_tests 1171/1 (1375)');
105 ok((not ("C:/" ~~ rx:P5/^([a-z]:)/)), 're_tests 1173 (1377)');
106 ok(("\nx aa" ~~ rx:P5/(?m)^\S\s+aa$/), 're_tests 1175 (1379)');
107 ok(("ab" ~~ rx:P5/(^|a)b/), 're_tests 1176 (1380)');
108 ok((not ("abcab" ~~ rx:P5/(\w)?(abc)\1b/)), 're_tests 1178 (1382)');
109 ok(("a,b,c" ~~ rx:P5/^(?:.,){2}c/), 're_tests 1180 (1384)');
110 is(("a,b,c" ~~ rx:P5/^(.,){2}c/ && $0), "b,", 're_tests 1182/1 (1386)');
111 ok(("a,b,c" ~~ rx:P5/^(?:[^,]*,){2}c/), 're_tests 1184 (1388)');
112 is(("a,b,c" ~~ rx:P5/^([^,]*,){2}c/ && $0), "b,", 're_tests 1186/1 (1390)');
113 is(("aaa,b,c,d" ~~ rx:P5/^([^,]*,){3}d/ && $0), "c,", 're_tests 1188/1 (1392)');
114 is(("aaa,b,c,d" ~~ rx:P5/^([^,]*,){3,}d/ && $0), "c,", 're_tests 1190/1 (1394)');
115 is(("aaa,b,c,d" ~~ rx:P5/^([^,]*,){0,3}d/ && $0), "c,", 're_tests 1192/1 (1396)');
116 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,3},){3}d/ && $0), "c,", 're_tests 1194/1 (1398)');
117 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,3},){3,}d/ && $0), "c,", 're_tests 1196/1 (1400)');
118 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,3},){0,3}d/ && $0), "c,", 're_tests 1198/1 (1402)');
119 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,},){3}d/ && $0), "c,", 're_tests 1200/1 (1404)');
120 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,},){3,}d/ && $0), "c,", 're_tests 1202/1 (1406)');
121 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{1,},){0,3}d/ && $0), "c,", 're_tests 1204/1 (1408)');
122 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{0,3},){3}d/ && $0), "c,", 're_tests 1206/1 (1410)');
123 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{0,3},){3,}d/ && $0), "c,", 're_tests 1208/1 (1412)');
124 is(("aaa,b,c,d" ~~ rx:P5/^([^,]{0,3},){0,3}d/ && $0), "c,", 're_tests 1210/1 (1414)');
125 ok(("" ~~ rx:P5/(?i)/), 're_tests 1212 (1416)');
126 ok(("a\nxb\n" ~~ rx:P5/(?m)(?!\A)x/), 're_tests 1214 (1418)');
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
127
128 # vim: ft=perl6
Something went wrong with that request. Please try again.