Skip to content

Commit

Permalink
Test bare \b and \B in regexes are forbidden
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Dec 4, 2016
1 parent 23431df commit 846af2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S05-metasyntax/regex.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 42;
plan 47;

throws-like 'qr/foo/', X::Obsolete, 'qr// is gone';

Expand Down Expand Up @@ -150,4 +150,12 @@ throws-like 'Regex.new.perl', Exception, '"Regex.new.perl dies but does not segf
ok 'a' ~~ /a:/, '/a:/ is a valid pattern and matches a';
ok 'a' ~~ /a: /, '/a: / is a valid pattern and matches a';

{ # RT #128986
throws-like '/\b/', X::Obsolete, 'bare \b is no longer supported';
throws-like '/\B/', X::Obsolete, 'bare \B is no longer supported';
ok "\b" ~~ /"\b"/, '\b still works when quoted';
ok "\b" ~~ /<[\b]>/, '\b still works in character class';
is ("a\bc" ~~ m:g/<[\B]>/).join, 'ac', '\B still works in character class';
}

# vim: ft=perl6

0 comments on commit 846af2a

Please sign in to comment.