NAME
URI::Fast::Test - Unit test comparisons for URI::Fast objects
SYNOPSIS
use URI::Fast::Test;
is_same_uri uri($got), uri($expected), 'got expected uri';
isnt_same_uri uri($got), uri($unwanted), 'did not get unwanted uri';
EXPORTS
is_same_uri
Builds a nested structure of uri components for comparison with Test2's deep comparison using is
. The test subjects may be either URI::Fast objects or strings, in which case they will be parsed into URI::Fast objects.
isnt_same_uri
Builds a nested structure of uri components for comparison with Test2's deep comparison using isnt
. The test subjects may be either URI::Fast objects or strings, in which case they will be parsed into URI::Fast objects.
SUBROUTINES
export_uri
Exports a URI::Fast object as a hash ref for use with Test2's comparison functions. The return value's structure is:
{
scheme => $uri->scheme,
usr => $uri->usr,
pwd => $uri->pwd,
host => $uri->host,
port => $uri->port,
path => [$uri->path],
query => $uri->query_hash,
frag => $uri->frag,
}
AUTHOR
Jeff Ober <sysread@fastmail.fm>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.