File: remove.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 (27 lines) | stat: -rw-r--r-- 640 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
use Set::Object;

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

populate();

$patty = $patty;
$selma = $selma;
$burns = $burns;

$simpsons = Set::Object->new($homer, $marge, $bart, $lisa, $maggie);

print "1..3\n";

$removed = $simpsons->remove($homer);
print 'not ' unless $simpsons->size() == 4 && $removed == 1
   && $simpsons == Set::Object->new($marge, $bart, $lisa, $maggie);
print "ok 1\n";

$removed = $simpsons->remove($burns);
print 'not ' unless $simpsons->size() == 4 && $removed == 0;
print "ok 2\n";

$removed = $simpsons->remove($patty, $marge, $selma);
print 'not ' unless $simpsons->size() == 3 && $removed == 1;
print "ok 3\n";