use
strict;
use
warnings;
use
Test::More;
use
MyNote;
BEGIN {
@OPTS
=
qw(uuid5 parse unparse type variant)
;
}
my
$bin
;
my
$str
= uuid5(
dns
=>
'www.example.com'
);
note
''
;
note
$str
;
ok
defined
(
$str
),
'defined'
;
ok
length
(
$str
) == 36,
'length'
;
ok !parse(
$str
,
$bin
),
'parsable'
;
# must be v5
my
$type
= type(
$bin
);
is
$type
, 5,
'correct type'
;
# all are variant 1
is variant(
$bin
), 1,
'correct variant'
;
my
$foo
;
unparse(
$bin
,
$foo
);
is
$foo
,
$str
,
'unparse'
;
note
$foo
;
done_testing;