-
Notifications
You must be signed in to change notification settings - Fork 135
/
sigspace.t
40 lines (29 loc) · 1.11 KB
/
sigspace.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use v6;
use Test;
=begin pod
Parts of this file were originally derived from the perl5 CPAN module
Perl6::Rules, version 0.3 (12 Apr 2004), file t/word.t.
=end pod
plan 12;
ok(!( "abc def" ~~ m/abc def/ ), 'Literal space nonmatch' );
#?pugs todo
ok( "abcdef" ~~ m/abc def/, 'Nonspace match' );
#?pugs todo
ok( "abc def" ~~ m:s/abc def/, 'Word space match' );
#?pugs todo
ok( 'abc def' ~~ ms/abc def/, 'word space match with ms//');
#?pugs todo
ok( "abc\ndef" ~~ m:sigspace/abc def/, 'Word newline match' );
ok(!( "abcdef" ~~ m:sigspace/abc def/ ), 'Word nonspace nonmatch' );
#?pugs todo
ok( "abc def" ~~ m:sigspace/abc <.ws> def/, 'Word explicit space match');
#?pugs todo
ok 'abc def' ~~ m/:s abc def/, 'inline :s (+)';
ok 'zabc def' !~~ m/:s abc def/, 'inline :s implies <.ws> immediately (-)';
#?pugs todo
ok 'zabc def' ~~ m/:s'abc' def/, 'inline :s implies <.ws> immediately (+)';
# L<S05/Modifiers/The :s modifier is considered sufficiently important>
#?pugs todo
ok 'abc def' ~~ ms/c d/, 'ms// works, implies :s (+)';
ok 'abcdef' !~~ ms/c d/, 'ms// works, implies :s (-)';
# vim: ft=perl6