This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test %main::OVERLOAD, which was almost broken by a proposed fix for
authorFather Chrysostomos <sprout@cpan.org>
Mon, 13 Sep 2010 00:34:21 +0000 (02:34 +0200)
committerFlorian Ragwitz <rafl@debian.org>
Mon, 13 Sep 2010 00:34:21 +0000 (02:34 +0200)
[perl #76138].

lib/overload.t

index da580ca..417c1cb 100644 (file)
@@ -47,7 +47,8 @@ sub numify { 0 + "${$_[0]}" } # Not needed, additional overhead
 package main;
 
 $| = 1;
-use Test::More tests => 4880;
+BEGIN { require './test.pl' }
+plan tests => 4881;
 
 use Scalar::Util qw(tainted);
 
@@ -1990,4 +1991,12 @@ foreach my $op (qw(<=> == != < <= > >=)) {
     }
 }
 
+# Test overload from the main package
+fresh_perl_is
+ '$^W = 1; use overload q\""\ => sub {"ning"}; print bless []',
+ 'ning',
+  { switches => ['-wl'], stderr => 1 },
+ 'use overload from the main package'
+;
+
 # EOF