Summary: | Test for C4::Heading::MARC21 should only run under MARC21 | ||
---|---|---|---|
Product: | Koha | Reporter: | Jared Camins-Esakov <jcamins> |
Component: | Test Suite | Assignee: | Jared Camins-Esakov <jcamins> |
Status: | CLOSED FIXED | QA Contact: | Ian Walls <koha.sekjal> |
Severity: | minor | ||
Priority: | P5 - low | CC: | magnus, paul.poulain |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 7702: MARC21 heading tests should not run under UNIMARC
Bug 7702: MARC21 heading tests should not run under UNIMARC Bug 7702: [SIGNED-OFF] MARC21 heading tests should not run under UNIMARC |
Description
Jared Camins-Esakov
2012-03-11 16:48:01 UTC
Created attachment 8158 [details] [review] Bug 7702: MARC21 heading tests should not run under UNIMARC Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is UNIMARC. To be absolutely explicit, I'd recommend change the conditional from "if not UNIMARC" to "if MARC21 OR NORMARC", so if we later implement another form of MARC, we won't have to remember to adjust this. Ounce of prevention and all that.... Created attachment 8605 [details] [review] Bug 7702: MARC21 heading tests should not run under UNIMARC Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is UNIMARC. Signed-off-by: Magnus Enger <magnus@enger.priv.no> I set marcflavour = UNIMARC for testing this. Before the patch, t/Heading_MARC21.t fails. After the patch it succeeds. Created attachment 8606 [details] [review] Bug 7702: [SIGNED-OFF] MARC21 heading tests should not run under UNIMARC Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is UNIMARC. Signed-off-by: Magnus Enger <magnus@enger.priv.no> I set marcflavour = UNIMARC for testing this. Before the patch, t/Heading_MARC21.t fails. After the patch it succeeds. Signed-off-by: Magnus Enger <magnus@enger.priv.no> $ t/Heading_MARC21.t 1..3 ok 1 - use C4::Heading; ok 2 - Display form generation not ok 3 - Search form generation # Failed test 'Search form generation' # at t/Heading_MARC21.t line 18. # got: 'Uncles Fiction' # expected: 'Uncles generalsubdiv Fiction' # Looks like you failed 1 test of 3. $ git bz apply 7702 Bug 7702 - Test for C4::Heading::MARC21 should only run under MARC21 Bug 7702: MARC21 heading tests should not run under UNIMARC Apply? [yn] y Applying: Bug 7702: MARC21 heading tests should not run under UNIMARC $ t/Heading_MARC21.t 1..3 ok 1 - use C4::Heading; ok 2 # skip MARC21 heading tests not applicable to UNIMARC ok 3 # skip MARC21 heading tests not applicable to UNIMARC Since our NORMARC expert has signed off on this, I'll take that as a sign that we're good with the test for 'not UNIMARC'. Marking Passed QA. works fine for UNIMARC as well: 15:53 ~/koha.dev/koha-community (new/bug_7702 $%)$ perl t/Heading_MARC21.t 1..3 ok 1 - use C4::Heading; ok 2 # skip MARC21 heading tests not applicable to UNIMARC ok 3 # skip MARC21 heading tests not applicable to UNIMARC (In reply to comment #2) > To be absolutely explicit, I'd recommend change the conditional from "if not > UNIMARC" to "if MARC21 OR NORMARC", so if we later implement another form of > MARC, we won't have to remember to adjust this. Ounce of prevention and all > that.... I think this uses the same logic as elsewhere in the code where we branch out based on the marcflavour syspref. Here's some code from C4/Koha.pm: if ($marcflavour eq 'UNIMARC') { ... } else { # assume marc21 if not unimarc ... } NORMARC can (luckily) be treated as MARC21 in a lot of contexts. |