summaryrefslogtreecommitdiff
path: root/t/op/override.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/override.t')
-rwxr-xr-xt/op/override.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/override.t b/t/op/override.t
index 9cbd57370b..60d772b6c9 100755
--- a/t/op/override.t
+++ b/t/op/override.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 22;
+plan tests => 26;
#
# This file tries to test builtin override using CORE::GLOBAL
@@ -80,6 +80,19 @@ BEGIN { *Rgs::readline = sub (;*) { --$r }; }
::is( <$pad_fh> , 11 );
}
+# Global readpipe() override
+BEGIN { *CORE::GLOBAL::readpipe = sub ($) { "$_[0] " . --$r }; }
+is( `rm`, "rm 10", '``' );
+is( qx/cp/, "cp 9", 'qx' );
+
+# Non-global readpipe() override
+BEGIN { *Rgs::readpipe = sub ($) { ++$r . " $_[0]" }; }
+{
+ package Rgs;
+ ::is( `rm`, "10 rm", '``' );
+ ::is( qx/cp/, "11 cp", 'qx' );
+}
+
# Verify that the parsing of overriden keywords isn't messed up
# by the indirect object notation
{