From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

Test2::Plugin::UUID - Use REAL UUIDs in Test2

DESCRIPTION

Test2 normally uses unique IDs generated by appending pid, thread-id, and an incrementing integer. These work fine most of the time, but are not sufficient if you want to keep a database of events, in that case a real UUID is much more useful.

SYNOPSIS

use Test2::Plugin::UUID;

This is also useful at the command line for 1-time use:

$ perl -MTest2::Plugin::UUID path/to/test.t

CONTROLLING WARNINGS AND BACKENDS

You can turn off backend warnings, and choose your own backend order preference:

use Test2::Plugin::UUID warn => 0, backends => ['UUID', ...];

Or at the command line:

perl -MTest2::Plugin::UUID=warn,0 path/to/test.t

Or via env vars:

TEST2_UUID_BACKEND="UUID,Data::UUID::MT" TEST2_UUID_WARN=0 perl path/to/test.t

Normally warnings will be issued if UUID::Tiny or Data::UUID are used as the first is slow and the second is not suitible for database keys.

BACKENDS

One of the following modules will be used under the hood, they are listed here in order of preference.

SOURCE

The source code repository for Test2-Plugin-UUID can be found at https://github.com/Test-More/Test2-Plugin-UUID/.

MAINTAINERS

AUTHORS

COPYRIGHT

Copyright 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/