Skip to content
Newer
Older
100644 28 lines (19 sloc) 900 Bytes
c535816 [t] move lookaround.t to spec/
moritz authored Feb 19, 2009
1 use v6;
2 use Test;
3
4 =begin pod
5
6 This file was originally derived from the perl5 CPAN module Perl6::Rules,
7 version 0.3 (12 Apr 2004), file t/lookaround.t.
8
9 =end pod
10
11 plan 10;
12
13 # L<S05/Extensible metasyntax (C<< <...> >>)/The special named assertions include:>
14
15 ok("a cdef" ~~ m/<after a <.ws> c> def/, 'Lookbehind');
16 ok(!( "acdef" ~~ m/<after a <.ws> c> def/ ), 'Lookbehind failure');
17 ok(!( "a cdef" ~~ m/<!after a <.ws> c> def/ ), 'Negative lookbehind failure');
18 ok("acdef" ~~ m/<!after a <.ws> c> def/, 'Negative lookbehind');
19
20 ok("abcd f" ~~ m/abc <before d <.ws> f> (.)/, 'Lookahead');
21 is(~$0, 'd', 'Verify lookahead');
22 ok(!( "abcdef" ~~ m/abc <before d <.ws> f>/ ), 'Lookahead failure');
23 ok(!( "abcd f" ~~ m/abc <!before d <.ws> f>/ ), 'Negative lookahead failure');
24 ok("abcdef" ~~ m/abc <!before d <.ws> f> (.)/, 'Negative lookahead');
25 is(~$0, 'd', 'Verify negative lookahead');
26
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored Aug 8, 2009
27 # vim: ft=perl6
Something went wrong with that request. Please try again.