Created
February 25, 2014 10:25
-
-
Save hisaichi5518/9206427 to your computer and use it in GitHub Desktop.
必ず10個返す
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use List::Util; | |
| use Test::More; | |
| sub fill { | |
| my ($list) = @_; | |
| my $max = 10; | |
| [@$list, map { undef } 1..($max - scalar(@$list))] | |
| } | |
| is scalar(@{fill([1..10])}), 10; | |
| is scalar(@{fill([1..3])}), 10; | |
| is scalar(@{fill([])}), 10; | |
| done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment