Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic migration documentation #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Test2/Manual.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ writing new tools.

The L<Test2::Manual::EndToEnd> is an overview of Test2 from load to finish.

=head1 MIGRATING

The L<TEST2::Manual::Migrating> is an short guide to assist when migrating from the
Test:: family of modules to the TEST2:: modules.

=head1 CONTRIBUTING

The L<Test2::Manual::Contributing> POD is for people who want to contribute to
Expand Down
70 changes: 70 additions & 0 deletions lib/Test2/Manual/Migrating.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
=pod

=head1 MIGRATING

There are good reasons for migrating from the Test:: family of modules to
the Test2:: modules. This document as well as describing some of these
reaasons also aims to give some simple guidance on how to migrate your
tests to Test2.

=head1 EXAMPLE

=head2 Test::

use strict;
use utf8;
use warnings;

use Test::Deep;
use Test::Fatal;
use Test::More;
use Test::Warnings;

binmode Test::More->builder->$_, ':encoding(UTF-8)'
for qw/failure_output output/;

ok 1;

is $foo, $bar;

is_deeply $foo => [1..9];

like $foo, qr/A-Z/;

cmp_deeply $foo => {
bar => ignore,
baz => re(qr(A-Z)),
qux => 1,
};

is warning { ... }, 'foo';

dies_ok { ... };

done_testing;

=head2 Test2::

use Test2::V0;

ok 1;

is $foo, $bar;

is $foo => [1..9];

like $foo, qr/A-Z/;

like $foo => {
baz => qr(A-Z),
qux => 1,
};

is warning { ... }, 'foo';

ok dies { ... };

done_testing;

=cut