Skip to content

Commit

Permalink
Merge pull request #1571 from dz-at-tc/add_subtests_to_mojo_signatures_t
Browse files Browse the repository at this point in the history
Convert t/mojo/signatures.t to use subtests
  • Loading branch information
mergify[bot] authored Oct 11, 2020
2 parents 39989a0 + 4e55a68 commit f712428
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions t/mojo/signatures.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ sub foo ($self, $bar, $baz) { $bar - $baz }

package main;

# Basics
my $test = MojoSignatureBaseTest->new;
is($test->foo(23, 24), 47, 'right result');

# Random order flags
my $test2 = MojoSignatureBaseTest2->new;
is($test2->foo(26, 24), 2, 'right result');

# Bad flag
eval "package MojoSignaturesTest3; use Mojo::Base -unsupported";
like $@, qr/Unsupported flag: -unsupported/, 'right error';
subtest 'Basics' => sub {
my $test = MojoSignatureBaseTest->new;
is($test->foo(23, 24), 47, 'right result');
};

subtest 'Random order flags' => sub {
my $test2 = MojoSignatureBaseTest2->new;
is($test2->foo(26, 24), 2, 'right result');
};

subtest 'Bad flag' => sub {
eval "package MojoSignaturesTest3; use Mojo::Base -unsupported";
like $@, qr/Unsupported flag: -unsupported/, 'right error';
};

done_testing();

0 comments on commit f712428

Please sign in to comment.