File: misc.t

package info (click to toggle)
libset-scalar-perl 1.29-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: perl: 932; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (5)
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
use Set::Scalar;

print "1..3\n";

{
	# Malcolm Purvis <malcolm.purvis@alcatel.com.au>
	my $s1 = Set::Scalar->new("A");
	my $s1_again = Set::Scalar->new("A");
	my $s2 = $s1->union($s1_again);
	my $s3 = Set::Scalar->new("C");
	my $s4 = $s2->difference($s3);
	print "not " unless $s4 eq "(A)";
	print "ok 1\n";
}

{
	# Malcolm Purvis <malcolm.purvis@alcatel.com.au>
	my $s1 = Set::Scalar->new(("A", "B"));
	my $s1_again = Set::Scalar->new(("A", "B"));
	my $s2 = $s1->union($s1_again);  
	my $s3 = Set::Scalar->new("C");
	my $s4 = $s2->difference($s3);
	print "not " unless $s4 eq "(A B)";
	print "ok 2\n";
}

{
	# Josh@allDucky.com
	use Set::Scalar;
	my $x = new Set::Scalar( [] );
	my @m = $x->members;
	print "not " unless $m[0] =~ /^ARRAY\(0x[0-9a-fA-F]+\)$/;
	print "ok 3\n";
}