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

Fix type check for args passed to add_words() #44

Merged
Merged
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
Fix type check for args passed to add_words()
@tobyink and @perlpunk worked out in
https://rt.cpan.org/Public/Bug/Display.html?id=144672 that the closing
square brace in the types check to the `add_words` sub was not in the
correct place.  As mentioned by @tobyink in the RT ticket:

> Versions of Type::Params prior to 2.000000 would not have spotted this mistake

@perlpunk provided the patch which I'm submitting in this commit.

This change makes the test suite pass again and would hence close both
issue #42 and issue #38.
paultcochrane committed Sep 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f08c216a04c4ec994e541c58704cd2200dc9f433
4 changes: 2 additions & 2 deletions lib/Crypt/HSXKPasswd/Dictionary/Basic.pm
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ sub add_words{
# validate args
state $args_check = multisig(
[NonEmptyString, Optional[Maybe[NonEmptyString]]],
[ArrayRef[Str]], Optional[Item],
[ArrayRef[Str], Optional[Item]],
);
my ($dict_source, $encoding) = $args_check->(@args);

@@ -272,4 +272,4 @@ sub add_words{
return $self;
}

1; # because Perl is just a little bit odd :)
1; # because Perl is just a little bit odd :)