diff options
author | Geoffrey T. Dairiki <dairiki at dairiki.org> | 2009-08-04 17:54:34 -0700 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2009-10-12 13:04:08 -0400 |
commit | c989e6a3e4b89b26d315693449c76cdcb754611f (patch) | |
tree | 4b8dcd0906c356678b4f9e22aec507e23c63d46c /t/lib | |
parent | 3a2461997c4ea41f425afe2d21ff1e63cbd07365 (diff) | |
download | perl-c989e6a3e4b89b26d315693449c76cdcb754611f.tar.gz |
overload no longer implicitly unsets fallback on repeated 'use overload' lines - Fix for RT#68916
Subject: overload::import resets the setting of 'fallback'
Date: Tue, 04 Aug 2009 17:54:34 -0700
From: "Geoffrey T. Dairiki" <dairiki at dairiki.org>
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/overload_fallback.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/lib/overload_fallback.t b/t/lib/overload_fallback.t new file mode 100644 index 0000000000..6b50042475 --- /dev/null +++ b/t/lib/overload_fallback.t @@ -0,0 +1,18 @@ +use warnings; +use strict; +use Test::Simple tests => 2; + +use overload '""' => sub { 'stringvalue' }, fallback => 1; + +BEGIN { +my $x = bless {}, 'main'; +ok ($x eq 'stringvalue', 'fallback worked'); +} + + +# NOTE: delete the next line and this test script will pass +use overload '+' => sub { die "unused"; }; + +my $x = bless {}, 'main'; +ok (eval {$x eq 'stringvalue'}, 'fallback worked again'); + |