From 25222ff958727e01a3a480924b65ba188c7c3ea2 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 13 Sep 2010 02:34:21 +0200 Subject: Test %main::OVERLOAD, which was almost broken by a proposed fix for [perl #76138]. --- lib/overload.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/overload.t') diff --git a/lib/overload.t b/lib/overload.t index da580ca4fe..417c1cb043 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -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 -- cgit v1.2.1