This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cproto.t: Add tests for BEGIN, etc.
[perl5.git] / t / lib / overload_nomethod.t
CommitLineData
73512201
DG
1use warnings;
2use strict;
3use Test::Simple tests => 3;
4
5package Foo;
6use overload
7 nomethod => sub { die "unimplemented\n" };
8sub new { bless {}, shift };
9
10package main;
11
12my $foo = Foo->new;
13
14eval {my $val = $foo + 1};
15ok( $@ =~ /unimplemented/ );
16
17eval {$foo += 1};
18ok( $@ =~ /unimplemented/ );
19
20eval {my $val = 0; $val += $foo};
21ok( $@ =~ /unimplemented/ );
22