Skip to content

Commit

Permalink
save work
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Jan 20, 2024
1 parent 0835b36 commit 329dc4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions t/9-junction.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,47 @@ my @args = $junction.split("|");
my ($ntests, $nfails);
my $nargs = @args.elems;

my $regex = /{$junction}/;

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

# subtest 2
subtest {
$target = "Args";
$junction = /(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-junction(:$regex, :$junction, :$target, :@args);
$regex = /(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-regex(:$regex, :$target, :@args);
is $ntests, $nargs, "ntests $ntests";
is $nfails, 0, "expect 0 fails, got $nfails";
}, "subtest 2";

# subtest 3
subtest {
$target = "Args";
$junction = /^(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-junction(:$regex, :$target, :@args);
$regex = /^(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-regex(:$regex, :$target, :@args);
is $ntests, $nargs, "ntests $ntests";
is $nfails, 0, "Expected 0 fails, got $nfails";
}, "subtest 3";

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

# subtest 5
subtest {
$target = "NArgs";
$junction = /(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-junction(:$regex, :$target, :@args);
$regex = /(A|Ar|Arg|Args)/;
($ntests, $nfails) = test-regex(:$regex, :$target, :@args);
is $ntests, $nargs, "ntests $ntests";
is $nfails, 0, "Expected 0 fails, got $nfails";
}, "subtest 5";
Expand Down
2 changes: 1 addition & 1 deletion t/Utils/Subs.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ unit module Subs;

use Abbreviations :ALL;

sub test-junction(
sub test-regex(
:$target!,
:@args!,
:$regex!,
Expand Down

0 comments on commit 329dc4e

Please sign in to comment.