Skip to content

Commit

Permalink
Tests for infix<xx> with -Inf and ±NaN
Browse files Browse the repository at this point in the history
Final set of tests for RT #125628
  • Loading branch information
MasterDuke17 committed Sep 7, 2016
1 parent 456bb43 commit fb22ba6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion S03-operators/repeat.t
Expand Up @@ -8,7 +8,7 @@ Repeat operators for strings and lists
=end description

plan 44;
plan 47;

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

Expand Down Expand Up @@ -43,6 +43,25 @@ is 'str' x Int, '', 'x with Int type object';
);
isa-ok('a' x Inf, Failure, 'repeating with Inf is a Failure');
isa-ok('a' x *, WhateverCode, 'repeating with * is a WhateverCode');

throws-like(
{ 'a' xx -NaN },
X::AdHoc,
message => 'Cannot coerce NaN to an Int',
'list repeating with -NaN fails'
);
throws-like(
{ 'a' xx NaN },
X::AdHoc,
message => 'Cannot coerce NaN to an Int',
'list repeating with NaN fails'
);
throws-like(
{ 'a' xx -Inf },
X::AdHoc,
message => 'Cannot coerce -Inf to an Int',
'list repeating with -Inf fails'
);
}

#L<S03/Changes to Perl 5 operators/"and xx (which creates a list of repetitions of a list or item)">
Expand Down

0 comments on commit fb22ba6

Please sign in to comment.