Skip to content

Commit

Permalink
Test %main::OVERLOAD, which was almost broken by a proposed fix for
Browse files Browse the repository at this point in the history
[perl #76138].
  • Loading branch information
Father Chrysostomos authored and rafl committed Sep 13, 2010
1 parent 92d2342 commit 25222ff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/overload.t
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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

0 comments on commit 25222ff

Please sign in to comment.