Created
September 29, 2011 07:13
-
-
Save notbenh/1250159 to your computer and use it in GitHub Desktop.
annon { $label => ...} with out assignment is seen as a list?
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 strict; | |
use warnings; | |
use Test::Most qw{no_plan}; | |
my $data = [{ label => {key => 'value'}}]; | |
eq_or_diff | |
[ map{ my $hash = $_; | |
my $x = | |
{ map { my $label = $_; | |
$label => $hash->{$label} | |
} keys %$hash | |
} | |
} @$data | |
], | |
[ map{ my $hash = $_; | |
#my $x = | |
{ map { my $label = $_; | |
$label => $hash->{$label} | |
} keys %$hash | |
} | |
} @$data | |
], | |
q| annon { $label => ...} with out assignment is seen as a list? |; | |
__END__ | |
not ok 1 - annon { $label => ...} with out assignment is seen as a list? | |
# Failed test ' annon { $label => ...} with out assignment is seen as a list? ' | |
# at data_eq.t line 17. | |
# +----+----------------------+----+--------------------+ | |
# | Elt|Got | Elt|Expected | | |
# +----+----------------------+----+--------------------+ | |
# | 0|[ | 0|[ | | |
# | | * 1| 'label', * | |
# | 1| { | 2| { | | |
# * 2| label => { * 3| key => 'value' * | |
# * 3| key => 'value' * | | | |
# * 4| } * | | | |
# | 5| } | 4| } | | |
# | 6|] | 5|] | | |
# +----+----------------------+----+--------------------+ | |
1..1 | |
# Looks like you failed 1 test of 1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ahhhh. Bare block that makes sence.