forked from Raku/roast
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchanged.t
44 lines (36 loc) · 1.1 KB
/
changed.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
41
42
43
44
use v6;
use Test;
plan 12;
# L<S05/Changed metacharacters>
{
# A dot . now matches any character including newline.
my $str = "abc\ndef";
#?pugs todo
ok($str ~~ /./, '. matches something');
#?pugs todo
ok($str ~~ /c.d/, '. matches \n');
# ^ and $ now always match the start/end of a string, like the old \A and \z.
#?pugs todo
ok($str ~~ /^abc/, '^ matches beginning of string');
ok(!($str ~~ /^de/), '^ does not match \n');
#?pugs todo
ok($str ~~ /def$/, '$ matches end of string');
ok(!($str ~~ /bc$/), '$ does not match \n');
# (The /m modifier is gone.)
eval_dies_ok('$str ~~ m:m/bc$/', '/m modifier (as :m) is gone');
}
# A $ no longer matches an optional preceding \n
{
my $str = "abc\ndef\n";
#?pugs todo
ok($str ~~ /def\n$/, '\n$ matches as expected');
ok(!($str ~~ /def$/), '$ does not match \n at end of string');
}
# The \A, \Z, and \z metacharacters are gone.
#?pugs todo
{
eval_dies_ok('/\A/', '\\A is gone');
eval_dies_ok('/\Z/', '\\Z is gone');
eval_dies_ok('/\z/', '\\z is gone');
}
# vim: ft=perl6