Skip to content

Commit

Permalink
Add barcode regex to standard identifier
Browse files Browse the repository at this point in the history
This causes one test to need a new count.

Fixup standard_identifiers
  • Loading branch information
matt-bernhardt committed Jan 9, 2025
1 parent 7f096da commit cc39da7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/detector/standard_identifiers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def self.record(term)
# patterns are regex patterns to be applied to the basic search box input
def patterns
{
barcode: /^39080[0-9]{9}$/,
isbn: /\b(ISBN-*(1[03])* *(: ){0,1})*(([0-9Xx][- ]*){13}|([0-9Xx][- ]*){10})\b/,
issn: /\b[0-9]{4}-[0-9]{3}[0-9xX]\b/,
pmid: /\b((pmid|PMID):\s?(\d{7,8}))\b/,
Expand Down
2 changes: 1 addition & 1 deletion test/models/detector/bulk_checker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CitationTest < ActiveSupport::TestCase
test 'standard_identifier_bulk_checker' do
bulk = Detector::StandardIdentifiers.check_all_matches(output: true)

assert_equal(5, bulk.count)
assert_equal(6, bulk.count)
end

test 'suggested_resources_bulk_checker' do
Expand Down

0 comments on commit cc39da7

Please sign in to comment.