File: uuid.t

package info (click to toggle)
libobject-id-perl 0.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 188 kB
  • sloc: perl: 289; makefile: 2
file content (35 lines) | stat: -r--r--r-- 549 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
31
32
33
34
35
#!/usr/bin/perl

# Test the optional object_uuid

use strict;
use warnings;

use Test::More;

plan skip_all => "Data::UUID not available for object_uuid" unless eval {
    require Data::UUID;
};

{
    package My::Class;
    use Object::ID;

    sub new {
        my $class = shift;
        bless {}, $class;
    }
}

{
    my $obj = new_ok "My::Class";
    ok $obj->object_uuid;

    my $copy = $obj;
    is $obj->object_uuid, $copy->object_uuid;

    my $obj2 = new_ok "My::Class";
    isnt $obj->object_uuid, $obj2->object_uuid;
}

done_testing;