Test::Stream::Plugin::Classic - Classing (Test::More) style is and is_deeply.
This distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow.
See Test::Stream::Manual::ToTest2 for a conversion guide.
This provides is() and is_deeply() functions that behave close to the way they did in Test::More, unlike the Test::Stream::Plugin::Compare plugin which has enhanced them (or ruined them, depending on who you ask).
is()
is_deeply()
use Test::Stream 'Classic'; is($got, $expect, "these are the same when stringified"); isnt($got, $unexpect, "these are not the same when stringified"); like($got, qr/.../, "'got' matches the pattern"); unlike($got, qr/.../, "'got' does not match the pattern"); is_deeply($got, $expect, "These structures are same when checked deeply");
This does a string comparison of the 2 arguments. If the 2 arguments are the same after stringification the test passes. The test will also pas sif both arguments are undef.
The test $name is optional.
$name
The test @diag is optional, it is extra diagnostics messages that will be displayed if the test fails. The diagnostics are ignored if the test passes.
@diag
It is important to note that this tool considers "1" and "1.0" to not be equal as it uses a string comparison.
"1"
"1.0"
See Test::Stream::Plugin::Compare if you want a is() function that tries to be smarter for you.
This is the inverse of is(), it passes when the strings are not the same.
Check if $got matches the specified pattern. Will fail if it does not match.
$got
This is the inverse of like(). This will fail if $got matches $pattern.
like()
$pattern
This does a deep check, it compares the structures in $got with those in $expect. It will recurse into hashrefs, arrayrefs, and scalar refs. All other values will be stringified and compared as strings. It is important to note that this tool considers "1" and "1.0" to not be equal as it uses a string comparison.
$expect
This is the same as Test::Stream::Plugin::Compare::is().
Test::Stream::Plugin::Compare::is()
Check if $thing->isa($type) for each type. You can also check if a reference is a specific ref type.
$thing->isa($type)
The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/.
Copyright 2015 Chad Granum <exodist7@gmail.com>.
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/
To install Test::Stream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Stream
CPAN shell
perl -MCPAN -e shell install Test::Stream
For more information on module installation, please visit the detailed CPAN module installation guide.