This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add Data-Dumper, up patchlevel to 71, various misc tweaks to
[perl5.git] / t / lib / dumper-ovl.t
1 #!./perl -w
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib' if -d '../lib';
6 }
7
8 use Data::Dumper;
9
10 print "1..1\n";
11
12 package Foo;
13 use overload '""' => 'as_string';
14
15 sub new { bless { foo => "bar" }, shift }
16 sub as_string { "%%%%" }
17
18 package main;
19
20 my $f = Foo->new;
21
22 print "#\$f=$f\n";
23
24 $_ = Dumper($f);
25 s/^/#/mg;
26 print $_;
27
28 print "not " unless /bar/ && /Foo/;
29 print "ok 1\n";
30