Skip to content

Commit

Permalink
got test 9 working
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Jan 20, 2024
1 parent 3630704 commit c84b54b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions t/9-junction.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Subs;

my $debug = 0;

#plan 20;
plan 6;

# Single word
my $target = "Args";
Expand All @@ -21,12 +21,14 @@ my $nargs = @args.elems;

# subtest 1
subtest {
plan 1;
$nfails = test-regex(:$regex, :@args);
is $nfails, 0, "expect 0 fails, got $nfails";
}, "subtest 1";

# subtest 2
subtest {
plan 1;
$target = "Args";
$regex = /(A|Ar|Arg|Args)/;
$nfails = test-regex(:$regex, :@args);
Expand All @@ -35,6 +37,7 @@ subtest {

# subtest 3
subtest {
plan 1;
$target = "Args";
@args = $junction.split("|");
$regex = /^(A|Ar|Arg|Args)/;
Expand All @@ -43,19 +46,22 @@ subtest {
}, "subtest 3";

# subtest 4
$target = "NArgs";
$junction = abbrev $target;
@args = $junction.split('|');
$nargs = @args.elems;
subtest {
$target = "NArgs";
plan 1;
$regex = /^(A|Ar|Arg|Args)/;
$nfails = test-regex(:$regex, :@args);
is $nfails, $nargs, "Expected $nargs fails, got $nfails";
}, "subtest 4";

# subtest 5
subtest {
$target = "NArgs";
plan 1;
$regex = /(A|Ar|Arg|Args)/;
$nfails = test-regex(:$regex, :@args);
is $nfails, 0, "Expected 0 fails, got $nfails";
is $nfails, 1, "Expected 1 fail, got $nfails";
}, "subtest 5";

done-testing;

0 comments on commit c84b54b

Please sign in to comment.