Skip to content

Commit

Permalink
#67 allow month
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 15, 2024
1 parent 3ac89ce commit afec75b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bibcop.pl
Expand Up @@ -428,7 +428,7 @@ sub check_month {
my (%entry) = @_;
if (exists $entry{'month'}) {
my $month = $entry{'month'};
if (not $month =~ /^[1-9]|10|11|12$/) {
if (not $month =~ /^[1-9]|10|11|12|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec$/) {
return "The format of the 'month' is wrong"
}
}
Expand Down
7 changes: 7 additions & 0 deletions perl-tests/checks.pl
Expand Up @@ -115,6 +115,13 @@ package bibcop;
check_passes($f, ('year' => '2022'));
check_passes($f, ('year' => '1612'));

$f = 'check_month';
check_fails($f, ('month' => 'January'));
check_fails($f, ('month' => '01'));
check_passes($f, ('month' => 'jan'));
check_passes($f, ('month' => '1'));
check_passes($f, ('month' => '12'));

$f = 'check_pages';
check_fails($f, ('pages' => '1a'));
check_fails($f, ('pages' => '40A'));
Expand Down

0 comments on commit afec75b

Please sign in to comment.