Skip to content

Commit

Permalink
Test that creating too large strings throws
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterDuke17 committed Mar 9, 2017
1 parent fe3b86e commit 40c7c4b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S03-operators/repeat.t
Expand Up @@ -9,7 +9,7 @@ Repeat operators for strings and lists
=end description

plan 60;
plan 62;

#L<S03/Changes to Perl 5 operators/"x (which concatenates repetitions of a string to produce a single string">

Expand Down Expand Up @@ -201,4 +201,13 @@ warns-like { 'x' x Int }, *.contains('uninitialized' & 'numeric'),
is-deeply (|() xx *)[^5], (Nil, Nil, Nil, Nil, Nil),
'empty slip with xx * works';

# RT #127971,130924
{
#?rakudo 2 todo "creating too large strings dies RT #127971,130924"
dies-ok { my $a = "a" x 2**30; my $b = "b" x 2**30; my $c = $a ~ $b; my $d = $b ~ $a; my $e = $c ~ $d; },
'concatenating strings with `~` that would create a too large result dies';
dies-ok { (('a' x 1000000) x 1000000) },
'repeating strings with `x` that would create a too large result dies';
}

# vim: ft=perl6

0 comments on commit 40c7c4b

Please sign in to comment.