Created
November 23, 2011 16:26
-
-
Save daxim/1389127 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use perl5i::latest; | |
use lib 't/lib'; | |
use Test::More; | |
use Test::perl5i; | |
is_deeply( | |
scalar [ 'foo', 'bar', 'baz' ]->rotate, | |
[ 'fbb', 'oaa', 'orz' ], | |
'Right array rotate' | |
); | |
is_deeply( | |
scalar [qw(AAA BBB 123)]->rotate, | |
[qw(AB1 AB2 AB3)] | |
); | |
is_deeply( | |
scalar [qw(A BBB 1234)]->rotate, | |
["AB1", " B2", " B3", " 4"] | |
); | |
is_deeply( | |
scalar [qw(AAA23 AB1D1 A1BC AAB212)]->rotate, | |
["AAAA", "AB1A", "A1BB", "2DC2", "31 1", " 2",] | |
); | |
is_deeply( | |
scalar ['AB C']->rotate->rotate, | |
['AB C'], | |
'rotated twice is identical' | |
); | |
is_deeply( | |
scalar []->rotate, | |
[], | |
); | |
is_deeply( | |
scalar ['']->rotate, | |
[''], | |
); | |
is_deeply( | |
scalar ['A']->rotate, | |
['A'], | |
); | |
is_deeply( | |
scalar ['00']->rotate, | |
['0', '0'], | |
); | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment