From: Jesse Luehrs Date: Thu, 21 Apr 2011 21:35:25 +0000 (-0500) Subject: fix up the inlining test X-Git-Tag: 2.0100~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e634486d965414db5475e7384314002e10251c5;p=gitmo%2FMoose.git fix up the inlining test --- diff --git a/t/type_constraints/inlining.t b/t/type_constraints/inlining.t index c5417ca..cdc4a21 100644 --- a/t/type_constraints/inlining.t +++ b/t/type_constraints/inlining.t @@ -57,7 +57,7 @@ my $not_inlinable = find_type_constraint('NotInlinable'); is( $aofi->_inline_check('$foo'), - q{ref($foo) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$foo})}, + q{do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})}}, 'got expected inline code for ArrayRef[Inlinable] constraint' ); @@ -86,7 +86,7 @@ subtype 'ArrayOfNotInlinable', is( $aofi->_inline_check('$foo'), - q{ref($foo) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$foo})}, + q{do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})}}, 'got expected inline code for ArrayOfInlinable constraint' ); @@ -110,7 +110,7 @@ subtype 'ArrayOfNotInlinable', is( $hoaofi->_inline_check('$foo'), - q{ref($foo) eq "HASH" && &List::MoreUtils::all(sub { ref($_) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$_}) }, values %{$foo})}, + q{do {my $check = $foo;ref($check) eq "HASH" && &List::MoreUtils::all(sub { do {my $check = $_;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})} }, values %{$check})}}, 'got expected inline code for HashRef[ArrayRef[Inlinable]] constraint' );