From: Ben Morrow Date: Tue, 20 Jan 2009 01:28:31 +0000 (+0000) Subject: Test stacked overloaded -X. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d57d24f51f1e1421107065f0f777ed2e565907e;p=p5sagit%2Fp5-mst-13.2.git Test stacked overloaded -X. --- diff --git a/t/op/filetest.t b/t/op/filetest.t index 0fec3c1..69bed0b 100755 --- a/t/op/filetest.t +++ b/t/op/filetest.t @@ -10,7 +10,7 @@ BEGIN { } use Config; -plan(tests => 28 + 27*10); +plan(tests => 28 + 27*12); ok( -d 'op' ); ok( -f 'TEST' ); @@ -100,10 +100,11 @@ my $over; { package OverFtest; - use overload -X => sub { - $over = [overload::StrVal($_[0]), $_[1]]; - "-$_[1]"; - }; + use overload + -X => sub { + $over = [overload::StrVal($_[0]), $_[1]]; + "-$_[1]"; + }; } { package OverString; @@ -122,7 +123,7 @@ my $over; { package OverNeither; - # Need fallback. Previous veraions of perl required 'fallback' to do + # Need fallback. Previous versions of perl required 'fallback' to do # -X operations on an object with no "" overload. use overload '+' => sub { 1 }, @@ -158,6 +159,7 @@ for my $op (split //, "rwxoRWXOezsfdlpSbctugkTMBAC") { ok( !$@, "-$op succeeds with random overloading" ) or diag( $@ ); is( $rv, eval "-$op \$nstr", "correct -$op with random overloading" ); -} -is( -r -f $ft, "-r", "stacked overloaded -X" ); + is( eval "-r -$op \$ft", "-r", "stacked overloaded -$op" ); + is( eval "-$op -r \$ft", "-$op", "overloaded stacked -$op" ); +}