NAME
Test2::Plugin::Wrap2ndArgumentOfFailedCompareTestWithString - A Test2 plugin that wraps 2nd argument of failed assertions with string()
SYNOPSIS
use Test2::Plugin::Wrap2ndArgumentOfFailedCompareTestWithString;
DESCRIPTION
Test2::Plugin::Wrap2ndArgumentOfFailedCompareTestWithString is a Test2 plugin that wraps 2nd argument of failed assertions with string()
.
use URI;
my $url = 'https://www.example.com'
my $uri = URI->new('https://www.example.com/');
is $url, $uri;
The above test passes on Test::More because Test::More::is
compares both arguments as string. On the contrary, the test fails on Test2::V0 because Test2::V0::is
checks both arguments are equal structurely (a string is not a URI instance).
use URI;
my $url = 'https://www.example.com'
my $uri = URI->new('https://www.example.com/');
is $url, string($uri);
This test passes on Test2::V0 because string()
enforces string comparison.
LICENSE
Copyright (C) utgwkk.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
utgwkk <utagawakiki@gmail.com>