diff options
author | Ben Morrow <ben@morrow.me.uk> | 2009-01-20 01:28:31 +0000 |
---|---|---|
committer | Ben Morrow <ben@morrow.me.uk> | 2009-03-25 21:14:06 +0000 |
commit | 4d57d24f51f1e1421107065f0f777ed2e565907e (patch) | |
tree | 56711feade4d913957ce3794d62189639745e544 /t/op/filetest.t | |
parent | c4c7412cbfdbea9a232b77ab3c0ef1200ed2da16 (diff) | |
download | perl-4d57d24f51f1e1421107065f0f777ed2e565907e.tar.gz |
Test stacked overloaded -X.
Diffstat (limited to 't/op/filetest.t')
-rwxr-xr-x | t/op/filetest.t | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t index 0fec3c12b7..69bed0bb26 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" ); +} |