3 # On platforms that don't support all of the filetest operators the code
4 # that faked the results of missing tests used to leave the test's
5 # argument on the stack.
13 my @ops = split //, 'rwxoRWXOezsfdlpSbctugkTMBAC';
15 plan( tests => @ops * 5 );
17 package o { use overload '-X' => sub { 1 } }
18 my $o = bless [], 'o';
21 ok( 1 == @{ [ eval "-$op 'TEST'" ] }, "-$op returns single value" );
22 ok( 1 == @{ [ eval "-$op *TEST" ] }, "-$op *gv returns single value" );
26 for my $m ("a", "b") {
28 $t = eval "-$op _" ? 0 : "foo";
31 is($m, "b", "-$op did not remove too many values from the stack");
37 for my $m ("c", "d") {
39 $t = eval "-$op -e \$^X" ? 0 : "bar";
42 is($m, "d", "-$op -e \$^X did not remove too many values from the stack");
47 my @foo = eval "-$op \$o";
48 is @foo, 1, "-$op \$overld did not leave \$overld on the stack";