File: 3parse.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 (22 lines) | stat: -rw-r--r-- 423 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
use strict;
use warnings;
use Test::More;
use MyNote;
use UUID ();


my $str = '00000000-0000-0000-0000-000000000000';
my $rc = UUID::parse($str,my $bin);
ok 1, 'parse null';

is $rc, 0, 'return ok';

my $bin2 = $bin;
$str = 'Peter is a moose.';
$rc = UUID::parse($str,$bin);
ok 1, 'parse bogus';
is $rc, -1, 'return ng';
is $str, 'Peter is a moose.', 'string unchanged';
is $bin, $bin2, 'binary unchanged';

done_testing;