Skip to content
Newer
Older
100644 69 lines (41 sloc) 1.82 KB
3fa34aa [spec] tests for single quotes (from from_perl6_rules)
moritz authored Jun 19, 2008
1 use v6;
2 use Test;
3
4 =begin description
5
6 This file was derived from the perl5 CPAN module Perl6::Rules,
7 version 0.3 (12 Apr 2004), file t/qinterp.t.
8
9 It has (hopefully) been, and should continue to be, updated to
10 be valid perl6.
11
12 =end description
13
2ccb444 @TimToady test fancy single quotes in regex
TimToady authored Nov 3, 2015
14 plan 30;
3fa34aa [spec] tests for single quotes (from from_perl6_rules)
moritz authored Jun 19, 2008
15
16 # L<S05/Simplified lexical parsing of patterns/Sequences of one or more glyphs of either type>
17
18
19 ok("ab cd" ~~ m/a 'b c' d/, 'ab cd 1');
20 ok(!( "abcd" ~~ m/a 'b c' d/ ), 'not abcd 1');
21 ok("ab cd" ~~ m/ab ' ' c d/, 'ab cd 2');
22
1e5917a @moritz simplify a regex test
moritz authored May 16, 2012
23 ok 'abab' ~~ m/'ab' **2/, "Single quotes group";
3fa34aa [spec] tests for single quotes (from from_perl6_rules)
moritz authored Jun 19, 2008
24
25 ok("ab/cd" ~~ m/ab '/' c d/, 'ab/cd');
2ccb444 @TimToady test fancy single quotes in regex
TimToady authored Nov 4, 2015
26 is("ab/cd" ~~ m/[\w+] +% '/'/, 'ab/cd', "Can use after %");
27
28
29 ok("ab cd" ~~ m/a ‘b c’ d/, 'ab cd 1');
30 ok(!( "abcd" ~~ m/a ‘b c’ d/ ), 'not abcd 1');
31 ok("ab cd" ~~ m/ab ‘ ’ c d/, 'ab cd 2');
32
33 ok 'abab' ~~ m/‘ab’ **2/, "Single quotes group";
34
35 ok("ab/cd" ~~ m/ab ‘/’ c d/, 'ab/cd');
36 is("ab/cd" ~~ m/[\w+] +%/’/, 'ab/cd', "Can use after %");
37
38
39 ok("ab cd" ~~ m/a ‚b c’ d/, 'ab cd 1');
40 ok(!( "abcd" ~~ m/a ‚b c’ d/ ), 'not abcd 1');
41 ok("ab cd" ~~ m/ab ‚ ’ c d/, 'ab cd 2');
42
43 ok 'abab' ~~ m/‚ab’ **2/, "Single quotes group";
44
45 ok("ab/cd" ~~ m/ab ‚/’ c d/, 'ab/cd');
46 is("ab/cd" ~~ m/[\w+] +%/’/, 'ab/cd', "Can use after %");
47
48
49 ok("ab cd" ~~ m/a ‚b c‘ d/, 'ab cd 1');
50 ok(!( "abcd" ~~ m/a ‚b c‘ d/ ), 'not abcd 1');
51 ok("ab cd" ~~ m/ab ‚ ‘ c d/, 'ab cd 2');
52
53 ok 'abab' ~~ m/‚ab‘ **2/, "Single quotes group";
54
55 ok("ab/cd" ~~ m/ab ‚/‘ c d/, 'ab/cd');
56 is("ab/cd" ~~ m/[\w+] +%/‘/, 'ab/cd', "Can use after %");
57
58
59 ok("ab cd" ~~ m/a 「b c」 d/, 'ab cd 1');
60 ok(!( "abcd" ~~ m/a 「b c」 d/ ), 'not abcd 1');
61 ok("ab cd" ~~ m/ab 「 」 c d/, 'ab cd 2');
62
63 ok 'abab' ~~ m/「ab」 **2/, "Single quotes group";
64
65 ok("ab/cd" ~~ m/ab 「/」 c d/, 'ab/cd');
66 is("ab/cd" ~~ m/[\w+] +%/」/, 'ab/cd', "Can use after %");
3fa34aa [spec] tests for single quotes (from from_perl6_rules)
moritz authored Jun 19, 2008
67
68 # vim: ft=perl6
Something went wrong with that request. Please try again.