Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some Cool tests for Parcel.rotate and List.rotate
  • Loading branch information
perlpilot committed Jul 24, 2015
1 parent f266c4e commit 49828cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion S02-types/parcel.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 52;
plan 54;

isa-ok (5, 7, 8), Parcel, '(5, 7, 8) is Parcel';
is +(5, 7, 8), 3, 'prefix:<+> on a Parcel';
Expand Down Expand Up @@ -80,6 +80,13 @@ is $(;).elems, 0, '$(;) parses, and is empty';
is ~$p, 'a b c d e', 'original still unmodified (negative)';
} #13

# RT125677 Make sure Parcel.rotate is Cool with stuff
{
my $p = <a b c d e>;
is ~$p.rotate('2'), 'c d e a b', '.rotate("2")';
is ~$p.rotate(2.5), 'c d e a b', '.rotate(2.5)';
} #2

{
cmp-ok <a b c>, '===', <a b c>, 'a b c === a b c';
ok (my $x1=42,1) !=== (42,1), '$x1 = 42,1 !==== 42,1'; # !=== not an op
Expand Down
9 changes: 8 additions & 1 deletion S32-array/rotate.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 27;
plan 29;

# L<S32::Containers/Array/rotate>

Expand Down Expand Up @@ -51,4 +51,11 @@ plan 27;
is ~@a, 'a b c d e', 'original still unmodified (negative)';
} #13

# RT125677 Make sure rotate is Cool with stuff
{
my @a = <a b c d e>;
is ~@a.rotate('2'), 'c d e a b', '.rotate("2")';
is ~@a.rotate(2.5), 'c d e a b', '.rotate(2.5)';
}

# vim: ft=perl6

0 comments on commit 49828cd

Please sign in to comment.