Bugzilla – Attachment 98238 Details for
Bug 24094
Authority punctuation mismatch prevents linking to correct records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24094: Unit tests
Bug-24094-Unit-tests.patch (text/plain), 2.86 KB, created by
Nick Clemens (kidclamp)
on 2020-01-31 14:26:50 UTC
(
hide
)
Description:
Bug 24094: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-31 14:26:50 UTC
Size:
2.86 KB
patch
obsolete
>From 13acdb5f82a96ebd8627ee1b39f608abdebebb4e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 31 Jan 2020 14:18:14 +0000 >Subject: [PATCH] Bug 24094: Unit tests > >--- > t/db_dependent/Biblio.t | 24 +++++++++++++++++++++++- > t/db_dependent/Heading_MARC21.t | 10 ++++++++-- > 2 files changed, 31 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index cc38e07201..99879c479f 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -644,7 +644,7 @@ subtest 'ModBiblio called from linker test' => sub { > }; > > subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { >- plan tests => 3; >+ plan tests => 6; > > # Set up mocks to ensure authorities are generated > my $biblio_mod = Test::MockModule->new( 'C4::Linker::Default' ); >@@ -678,6 +678,28 @@ subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { > "The generated record contains the correct subfields" > ); > >+ # Example series link with volume and punctuation >+ $record = MARC::Record->new(); >+ $field = MARC::Field->new('800','','','a' => 'Tolkien, J. R. R.', 'q' => '(John Ronald Reuel),', 'd' => '1892-1973.', 't' => 'Lord of the rings ;', 'v' => '1'); >+ $record->append_fields($field); >+ >+ ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef); >+ >+ is( $num_headings_changed, 1, 'We changed the one we passed' ); >+ is_deeply( $results->{added}, >+ {"Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings ;" => 1 }, >+ "We added an authority record for the heading" >+ ); >+ >+ # Now we check the authority record itself >+ $authority = GetAuthority( $record->subfield('800','9') ); >+ is( $authority->field('100')->as_string(), >+ "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings", >+ "The generated record contains the correct subfields" >+ ); >+ >+ >+ > }; > > # Cleanup >diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t >index 0e1f1c9a72..5cde3cde75 100755 >--- a/t/db_dependent/Heading_MARC21.t >+++ b/t/db_dependent/Heading_MARC21.t >@@ -6,7 +6,7 @@ > use strict; > use warnings; > >-use Test::More tests => 3; >+use Test::More tests => 5; > use C4::Context; > > BEGIN { >@@ -19,4 +19,10 @@ SKIP: { > my $heading = C4::Heading->new_from_bib_field($field); > is($heading->display_form(), 'Uncles--Fiction', 'Display form generation'); > is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation'); >-} >+ >+ $field = MARC::Field->new( '830', ' ', '4', a => 'The dark is rising ;', v => '3' ); >+ $heading = C4::Heading->new_from_bib_field($field); >+ is($heading->display_form(), 'The dark is rising ;', 'Display form generation'); >+ is($heading->search_form(), 'The dark is rising', 'Search form generation'); >+ >+} >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24094
:
98238
|
98239
|
98735
|
98736
|
99223
|
99224