Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Test-a-function/Raku/test-a-function.raku
Normal file
18
Task/Test-a-function/Raku/test-a-function.raku
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use Test;
|
||||
|
||||
sub palin( Str $string) { so $string.lc.comb(/\w/) eq $string.flip.lc.comb(/\w/) }
|
||||
|
||||
for
|
||||
'A man, a plan, a canal: Panama.' => True,
|
||||
'My dog has fleas' => False,
|
||||
"Madam, I'm Adam." => True,
|
||||
'1 on 1' => False,
|
||||
'In girum imus nocte et consumimur igni' => True,
|
||||
'' => True
|
||||
{
|
||||
my ($test, $expected-result) = .kv;
|
||||
is palin($test), $expected-result,
|
||||
"\"$test\" is {$expected-result??''!!'not '}a palindrome.";
|
||||
}
|
||||
|
||||
done-testing;
|
||||
Loading…
Add table
Add a link
Reference in a new issue