1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/usr/bin/perl -w
#
# check that objects retain things like overloading after going in
# and out of Set::Object containers
#
use strict;
use Set::Object;
require './t/object/Person.pm';
require './t/object/Saint.pm';
print "1..2\n";
my $person = new Person( firstname => "Montgomery", name => "Burns" );
my $set = Set::Object->new($person);
my ($newperson) = $set->members();
if ($newperson ne "Montgomery Burns") {
print "not ";
}
print "ok 1\n";
my $saint = Saint->new( firstname => "Timothy", name => "Leary" );
$set = Set::Object->new($saint);
my ($newsaint) = $set->members();
if ($newsaint ne "Saint Timothy Leary") {
print "not ";
}
print "ok 2\n";
|