File: valued.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 (30 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (3)
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
use Set::Scalar::Valued;

use strict;

print "1..9\n";

my $ns = Set::Scalar::Valued->new();

print $ns->is_null ? "ok 1\n" : "not ok 1\n";
print $ns->size == 0 ? "ok 2\n" : "not ok 2\n";

print $ns->null->is_null  ? "ok 3\n" : "not ok 4\n";
print $ns->null->size == 0 ? "ok 4\n" : "not ok 4\n";

my $vs = Set::Scalar::Valued->new(a=>1);

print $vs->is_null ? "not ok 5\n" : "ok 5\n";
print $vs->size == 0 ? "not ok 6\n" : "ok 6\n";

print $vs->null->is_null  ? "ok 7\n" : "not ok 7\n";
print $vs->null->size == 0 ? "ok 8\n" : "not ok 8\n";

my $a = Set::Scalar::Valued->new(a=>1);
my $b = Set::Scalar::Valued->new(a=>1, b=>2);
my $c = $a-$b;
print "$c" eq "()" ? "ok 9\n" : "not ok 9\n";