|
NAMETest2::Util::UUID - Utils for generating UUIDs under Test2. DESCRIPTIONThis module provides a consistent UUID source for all of Test2. SYNOPSIS use Test2::Util::UUID qw/gen_uuid looks_like_uuid uuid2bin bin2uuid/;
my $uuid = gen_uuid;
my $bin = bin2uuid($uuid);
my $uuid_again = uuid2bin($uuid);
UNDER THE HOODOne of the following modules will be used under the hood, they are listed here in order of preference.
CONTROLLING WARNINGSAT IMPORT use Test2::Util::UUID 'gen_uuid', warn => 0; Passing in "warn => 0" will disable the warnings normally issued when using UUID::Tiny or Data::UUID as a backend. SELECTING A BACKENDAT IMPORT If you wish to override the order and specify which backend to use you may do so by listing them during import prefixed with ':'. use Test2::Util::UUID 'gen_uuid', backends => [':UUID', ':UUID::Tiny']; The above will try the UUID module first, followed by the UUID::Tiny module. It will not try Data::UUID::MT or Data::UUID. Note: You must include these import arguments anywhere you import this module, otherwise the other imports will use the default list, resulting in different places using different UUIDs. THE $TEST2_UUID_BACKEND ENV VAR Setting the $TEST2_UUID_BACKEND env var to one of the backends, or a comma seperated list will override the default list for all imports. It will NOT override imports that specify their own lists. EXPORTS
SOURCEThe source code repository for Test2-Plugin-UUID can be found at https://github.com/Test-More/Test2-Plugin-UUID/. MAINTAINERSAUTHORSCOPYRIGHTCopyright Chad Granum <exodist@cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
|