File: union.t

package info (click to toggle)
libset-object-perl 1.02-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 104 kB
  • ctags: 26
  • sloc: perl: 148; makefile: 44
file content (28 lines) | stat: -rw-r--r-- 629 bytes parent folder | download
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
use Set::Object;

require 't/Person.pm';
package Person;

populate();

$simpsons = Set::Object->new($homer, $marge);
$bouviers = Set::Object->new($marge, $patty, $selma);
$both = Set::Object->new($homer, $marge, $patty, $selma);
$empty = Set::Object->new;

print "1..5\n";

print 'not ' unless $simpsons->union($bouviers) == $both;
print "ok 1\n";

print 'not ' unless $simpsons + $bouviers == $both;
print "ok 2\n";

print 'not ' unless $bouviers + $simpsons == $both;
print "ok 3\n";

print 'not ' unless $simpsons + $simpsons == $simpsons;
print "ok 4\n";

print 'not ' unless $simpsons + $empty == $simpsons;
print "ok 5\n";