diff options
Diffstat (limited to 'lib/overload.t')
-rw-r--r-- | lib/overload.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/overload.t b/lib/overload.t index fed261dafb..7657010a2a 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -48,7 +48,7 @@ package main; $| = 1; BEGIN { require './test.pl' } -plan tests => 5051; +plan tests => 5053; use Scalar::Util qw(tainted); @@ -2297,6 +2297,20 @@ is eval {"$a"}, overload::StrVal($a), 'fallback is inherited by classes that have their own overloading' or diag $@; +# package separators in method names +{ + package mane; + use overload q\""\ => "bear::strength"; + use overload bool => "bear'bouillon"; +} +@bear::ISA = 'food'; +sub food::strength { 'twine' } +sub food::bouillon { 0 } +$a = bless[], mane::; +is eval { "$a" }, 'twine', ':: in method name' or diag $@; +is eval { !$a }, 1, "' in method name" or diag $@; + + { # undefining the overload stash -- KEEP THIS TEST LAST package ant; use overload '+' => 'onion'; |