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

Adds tests for both versions of Pair #859

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
27 changes: 19 additions & 8 deletions S24-testing/12-subtest-todo.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 8;
plan 10;

sub output-has(Str:D $output, Int:D :$todos, Int:D :$fails, Int:D :$noks) {
my $todos-actual = +$output.comb('TODO');
Expand All @@ -23,11 +23,16 @@ sub output-has(Str:D $output, Int:D :$todos, Int:D :$fails, Int:D :$noks) {
}
$result
}

is_run 「use Test; plan 1; todo 1; subtest 'foos' => { ok 0; }」, {
my %common-case-one-results = (
:err{.&output-has: :0noks, :0fails, :0todos},
:out{.&output-has: :2noks, :2fails, :2todos}, :0status
}, 'case one';
:out{.&output-has: :2noks, :2fails, :2todos},
:0status
);
is_run 「use Test; plan 1; todo 1; subtest 'foos' => { ok 0; }」,
%common-case-one-results, 'case one';

is_run 「use Test; plan 1; todo 1; subtest { ok 0; } => "foos"」,
%common-case-one-results, 'case one with inverted Pair';

is_run 「use Test; plan 1; todo 1; subtest 'foos' => { ok 1; }」, {
:err{.&output-has: :0noks, :0fails, :0todos},
Expand All @@ -50,10 +55,16 @@ is_run 「use Test; plan 1; subtest 'foos' => { todo 1; ok 0; ok 0 }」, {
:out{.&output-has: :3noks, :1fails, :1todos}, :1status
}, 'case five';

is_run 「use Test; plan 1; todo 1; subtest 'foos' => { todo 1; ok 0; ok 0 }」, {
my %common-case-six-results = (
:err{.&output-has: :0noks, :0fails, :0todos},
:out{.&output-has: :3noks, :3fails, :3todos}, :0status
}, 'case six';
:out{.&output-has: :3noks, :3fails, :3todos},
:0status
);
is_run 「use Test; plan 1; todo 1; subtest 'foos' => { todo 1; ok 0; ok 0 }」,
%common-case-six-results, 'case six';

is_run 「use Test; plan 1; todo 1; subtest { todo 1; ok 0; ok 0 } => 'foos'」,
%common-case-six-results, 'case six with inverted Pair';

is_run 「use Test; plan 1; todo 1;
subtest 'foos' => {
Expand Down