File: num.t

package info (click to toggle)
libuuid-perl 0.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,092 kB
  • sloc: ansic: 2,374; perl: 580; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 525 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
29
30
31
32
#
# compare number to number.
#
use strict;
use warnings;
use Test::More;
use MyNote;
use UUID ':all';

ok 1, 'loaded';

{# number to number
    my $u0 = 431;
    my $u1 = 432;
    is compare($u0, $u1), -1, 'numnum 0';
    is compare($u1, $u0),  1, 'numnum 1';
}

{# number to undef
    my $u0 = 431;
    my $u1 = undef;
    is compare($u0, $u1),  1, 'numund 0';
    is compare($u1, $u0), -1, 'numund 1';
}

{# undef to undef
    my $u0 = undef;
    my $u1 = undef;
    is compare($u0, $u1),  0, 'undund 0';
}

done_testing;