Last active
September 27, 2016 20:39
-
-
Save dogbert17/4aeeed6a2bdfc0a5efa481a25a16f32b to your computer and use it in GitHub Desktop.
Attempt to write tests for roast
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
use v6; | |
use Test; | |
plan 2; | |
=begin description | |
This test tests C<duckmap>. | |
=end description | |
{ | |
my $list = (1, (2,3), "a"); | |
is-deeply duckmap(-> Int $x { $x ~~ Int ?? $x !! Any }, $list), (1, (2, 3), 'a'), "duckmap doesn't hang"; # RT #129321 | |
#?rakudo todo "RT #129363 duckmap doesn't preserve structure types" | |
my @arr = [1, [2,3], 4]; | |
is-deeply duckmap(-> Int $x { $x ~~ Int ?? $x !! Any }, @arr).WHAT, Array, "duckmap preserves structure types"; | |
} #2 | |
# vim: ft=perl6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment