, $u0), 0, 'compare binary equal 0';
is compare($u1, $u1), 0, 'compare binary equal 1';
isnt $u0, $u1, 'binary equal';
my $t0 = compare($u0, $u1);
my $t1 = compare($u1,
;
my $u1 = uuid4();
isnt $u0, $u1, 'string equal 0';
my $t0 = compare($u0, $u1);
my $t1 = compare($u1, $u0);
isnt $t0, 0, 'string equal 1';
isnt $t1, 0, 'string equal 2'
, $u0), 0, 'compare binary equal 0';
is compare($u1, $u1), 0, 'compare binary equal 1';
isnt $u0, $u1, 'binary equal';
my $t0 = compare($u0, $u1);
my $t1 = compare($u1,
;
my $u1 = uuid7();
isnt $u0, $u1, 'string equal 0';
my $t0 = compare($u0, $u1);
my $t1 = compare($u1, $u0);
isnt $t0, 0, 'string equal 1';
isnt $t1, 0, 'string equal 2'
($bin, $t, $str);
UUID::generate_time($bin);
ok 1, 'gen1';
$t = UUID::time($bin);
ok 1, 'time1';
isnt $t, 0, 'time1';
UUID::unparse($bin, $str);
ok 1, 'unparse1';
note 'UUID : ', $str;
note 'UUI
scalar(time);
UUID::generate_random($bin);
ok 1, 'gen2';
$t = UUID::time($bin);
ok 1, 'time2';
#isnt $t, 0, 'time2'; #broken by api change (JRM)
UUID::unparse($bin, $str);
ok 1, 'unparse2';
note 'U
note 'UUID time : ', $t;
UUID::clear($bin);
ok 1, 'gen3';
$t = UUID::time($bin);
ok 1, 'time3';
#isnt $t, 0, 'time3'; #broken by api change (JRM)
UUID::unparse($bin, $str);
ok 1, 'unparse3';
note 'U
($bin, $t, $str);
UUID::generate_time($bin);
ok 1, 'gen1';
$t = UUID::time($bin);
ok 1, 'time1';
isnt $t, 0, 'time1';
UUID::unparse($bin, $str);
ok 1, 'unparse1';
note 'UUID : ', $str;
note 'UUI
';
isnt $t, 0, 'time2';
UUID::unparse($bin, $str);
ok 1, 'unparse2';
note 'UUID : ', $str;
note 'UUID time : ', $t;
UUID::clear($bin);
ok 1, 'gen3';
$t = UUID::time($bin);
ok 1, 'time3';
isnt $t
'is null';
isnt $u4, $u0, 'binary not null';
is compare($u4, $u0), 1, 'greater than binary';
}
{# string
my $u4 = uuid4();
my $u0 = uuid0();
isnt $u4, $u0,
'is null';
isnt $u7, $u0, 'binary not null';
is compare($u7, $u0), 1, 'greater than binary';
}
{# string
my $u7 = uuid7();
my $u0 = uuid0();
isnt $u7, $u0,
'is null';
isnt $u1, $u0, 'binary not null';
is compare($u1, $u0), 1, 'greater than binary';
}
{# string
my $u1 = uuid1();
my $u0 = uuid0();
isnt $u1, $u0,
use Test::More;
use MyNote;
use UUID ':all';
ok 1, 'loaded';
{# junk 16
#
# this really isnt a "test", per se, but rather a
# demonstration of what UUID will do. it sees these
# two
$u0), 1, 'compare junk 16 equal 1';
}
{# junk 17
#
# what if one of the binary "uuid"s isnt? it reverts
# to simple string compare.
#
my $u0 = '12345678901234567';
my $u1 =
;
isnt $u5, $u0, 'binary not null';
is compare($u5, $u0), 1, 'greater than binary';
}
{# string
my $u5 = uuid5(dns => 'www.example.com');
my $u0 = uuid0();
isnt $u5,
'is null';
isnt $u6, $u0, 'binary not null';
is compare($u6, $u0), 1, 'greater than binary';
}
{# string
my $u6 = uuid6();
my $u0 = uuid0();
isnt $u6, $u0,
;
isnt $u3, $u0, 'binary not null';
is compare($u3, $u0), 1, 'greater than binary';
}
{# string
my $u3 = uuid3(dns => 'www.example.com');
my $u0 = uuid0();
isnt $u3,
UUID::generate_time($bin1);
ok 1, 'generate1';
UUID::generate_time($bin2);
ok 1, 'generate2';
isnt $bin1, $bin2, 'different';
UUID::copy($bin2, $bin1);
ok 1, 'copy';
is UUID::compare($bin1, $bin
in1 );
$bin2 = $bin1;
is UUID::compare( $bin1, $bin2 ), 0;
# make sure we get back a null if src isnt sane
$bin1 = 'x';
UUID::copy( $bin2, $bin1 );
ok UUID::is_null( $bin2 );
$bin1 = 'another really
UUID::generate_time($bin1);
ok 1, 'generate1';
UUID::generate_time($bin2);
ok 1, 'generate2';
isnt $bin1, $bin2, 'different';
UUID::copy($bin2, $bin1);
ok 1, 'copy';
is UUID::compare($bin1, $bin
in1 );
$bin2 = $bin1;
is UUID::compare( $bin1, $bin2 ), 0;
# make sure we get back a null if src isnt sane
$bin1 = 'x';
UUID::copy( $bin2, $bin1 );
ok UUID::is_null( $bin2 );
$bin1 = 'another really