Skip to content

Commit

Permalink
Test .substr errors has right suggestsions
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Dec 31, 2017
1 parent 6f36b02 commit e5b4f37
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion t/05-messages/02-errors.t
Expand Up @@ -2,7 +2,7 @@ use lib <t/packages/>;
use Test;
use Test::Helpers;

plan 22;
plan 24;

# RT #132295

Expand Down Expand Up @@ -174,4 +174,12 @@ subtest 'USAGE with subsets/where and variables with quotes' => {
'variable name does not get special quote treatment';
}

# RT #128039
{
throws-like { 'foo'.substr(5) }, X::OutOfRange,
:message(/'Start argument to substr' .+ 'should be in 0..3' .+ '*-5'/);
throws-like { ''.substr(1000) }, X::OutOfRange,
:message(/'should be in 0..0' .+ '*-1000'/);
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit e5b4f37

Please sign in to comment.