Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (31 sloc) 1.051 kB
2a013e1 [gsoc_spectest] tests for handling of unknown metasyntax and escaping…
Auzon authored
1 use v6;
2 use Test;
3
fcc3f59 @moritz robuster tests for RT #77110, #77386
moritz authored
4 plan 13;
2a013e1 [gsoc_spectest] tests for handling of unknown metasyntax and escaping…
Auzon authored
5
6 # L<S05/Simplified lexical parsing of patterns/not all non-identifier glyphs are currently meaningful as metasyntax>
7
8 # testing unknown metasyntax handling
9
10 eval_dies_ok('"aa!" ~~ /!/', '"!" is not valid metasyntax');
11 lives_ok({"aa!" ~~ /\!/}, 'escaped "!" is valid');
12 lives_ok({"aa!" ~~ /'!'/}, 'quoted "!" is valid');
13
14 eval_dies_ok('"aa!" ~~ /\a/', 'escaped "a" is not valid metasyntax');
15 lives_ok({"aa!" ~~ /a/}, '"a" is valid');
16 lives_ok({"aa!" ~~ /'a'/}, 'quoted "a" is valid');
fc2d82c [t] merge braces_in_rules.t into spec/S05-metasyntax/unknown.t
moritz authored
17
18 # used to be a pugs bug
19
21ca56b [t/spec] fudge S05-metasyntax/unknown.t for rakudo; correct a test
moritz authored
20 {
21 my rule foo { \{ };
22 ok '{' ~~ /<foo>/, '\\{ in a rule (+)';
23 ok '!' !~~ /<foo>/, '\\{ in a rule (-)';
24 }
fc2d82c [t] merge braces_in_rules.t into spec/S05-metasyntax/unknown.t
moritz authored
25
b80cf7d [t/spec] tests for RT #74832
moritz authored
26 # RT #74832
27 {
a238bb3 @moritz remove bogus test
moritz authored
28 dies_ok {eval('/ a+ + /')}, 'Cannot parse regex a+ +';
e5d54f6 @moritz fudge a test that nom accidentally passed before
moritz authored
29 #?rakudo todo 'RT 74832'
946cccf @coke niecza fudging
coke authored
30 #?niecza todo
ebfcb8a [t/spec] be more liberal with case of detected error message
moritz authored
31 ok "$!" ~~ /:i quantif/, 'error message mentions quantif{y,ier}';
b80cf7d [t/spec] tests for RT #74832
moritz authored
32 }
33
d18cdd7 @FROGGS Linked now closed RT ticket about unrecogn. metachar
FROGGS authored
34 # RT #77110, #77386
6dff118 @bbkr unescaped "-" is not valid regular expression metasyntax, RT #77110
bbkr authored
35 {
fcc3f59 @moritz robuster tests for RT #77110, #77386
moritz authored
36 BEGIN { @*INC.push('t/spec/packages/') };
37 use Test::Util;
38 throws_like '$_ = "0"; s/-/1/', X::Syntax::Regex::UnrecognizedMetachar, metachar => '-';
6dff118 @bbkr unescaped "-" is not valid regular expression metasyntax, RT #77110
bbkr authored
39 }
40
fc2d82c [t] merge braces_in_rules.t into spec/S05-metasyntax/unknown.t
moritz authored
41 # vim: ft=perl6
Something went wrong with that request. Please try again.