NYPL / discovery-api

Discovery API: the JSON-LD API supporting NYPL Shared Collection Catalog
MIT License
6 stars 0 forks source link

Fix broken annotated-marc test #325

Closed nonword closed 1 year ago

nonword commented 1 year ago

This was broken because one of the annotated-marc-tests randomly chose to assert that varFields with marc 246 and fieldTag u are mapped to "Added Title". In actuality, the rule didn't actually dictate a marc tag of 246. The rule the test was using was actually a fall-through rule applied to all varFields with fieldTag u.

(The logic of webpub.def is it's a series of patterns applied to varField and first- and second-indicator values. When nothing matches there, there is often a catch-all rule for the fieldTag.)

That rule is here

Since that rule has been removed in the latest webpub.def, our annotated-marc rules correctly no longer consider just any varField with fieldTag u as "Added Title". So I changed the test to be some other arbitrary assertion, this time for something more specific: It's asserting that a rule over varFields with marc 246 and 1st indicator '1' and second indicator '5' (hence the pattern ^24615) tags such a varField as "Added Title Page Title".