File: uuid.t

package info (click to toggle)
libobject-id-perl 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 176 kB
  • ctags: 9
  • sloc: perl: 291; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (5)
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
36
37
#!/usr/bin/perl

# Test the optional object_uuid

use strict;
use warnings;

use Module::Build;
use Test::More;

plan skip_all => "Data::UUID not available for object_uuid" unless do {
    my $build = Module::Build->resume;
    $build->feature("object_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;