diff --git a/bibcop.pl b/bibcop.pl index 8879435..bd60811 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -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" } } diff --git a/perl-tests/checks.pl b/perl-tests/checks.pl index 652dbb3..1e0cf83 100755 --- a/perl-tests/checks.pl +++ b/perl-tests/checks.pl @@ -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'));