Bugzilla – Attachment 109631 Details for
Bug 26364
XISBN.t makes a bad assumption about return values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26364: Check that return value isn't the value we don't want. Don't check for undef
Bug-26364-Check-that-return-value-isnt-the-value-w.patch (text/plain), 1.82 KB, created by
Nick Clemens (kidclamp)
on 2020-09-03 15:47:33 UTC
(
hide
)
Description:
Bug 26364: Check that return value isn't the value we don't want. Don't check for undef
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-09-03 15:47:33 UTC
Size:
1.82 KB
patch
obsolete
>From 6a437dba635d90fd6a568e3fd357dcee64596881 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 3 Sep 2020 09:56:00 +0000 >Subject: [PATCH] Bug 26364: Check that return value isn't the value we don't > want. Don't check for undef > >It seems sometimes we get an ISBN returned that matches a book in the sample data. One of the Harry Potter >books was matching the ISBN. Our real concern is not that we get nothing, but that we don't get the >same value we pass in. We should test for that > >To test: >1 - prove -v t/db_dependent/XISBN.t >2 - The failures are not consistent, so read the code and ensure we are making sense >--- > C4/XISBN.pm | 1 - > t/db_dependent/XISBN.t | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/XISBN.pm b/C4/XISBN.pm >index de9dc100fe..6f7c3bf4bc 100644 >--- a/C4/XISBN.pm >+++ b/C4/XISBN.pm >@@ -107,7 +107,6 @@ sub get_xisbns { > $unique_xisbns->{ $response_data->{content} }++; > my $xbiblio= _get_biblio_from_xisbn($response_data->{content}); > next unless $xbiblio; >- next if $xbiblio->{normalized_isbn} && $xbiblio->{normalized_isbn} eq $isbn; > push @xisbns, $xbiblio if $xbiblio && $xbiblio->{biblionumber} ne $biblionumber; > } > if ( wantarray ) { >diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t >index 4cc939d28a..4579ef0e12 100755 >--- a/t/db_dependent/XISBN.t >+++ b/t/db_dependent/XISBN.t >@@ -76,8 +76,8 @@ eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1,$biblionumber3); }; > SKIP: { > skip "Problem retrieving ThingISBN", 1 > unless $@ eq ''; >- is( $results_thingisbn->[0]->{biblionumber}, >- undef, >+ isnt( $results_thingisbn->[0]->{biblionumber}, >+ $biblionumber3, > "Doesn't get biblionumber if the biblionumber matches the one passed to the sub." ); > } > >-- >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 26364
:
109599
|
109631
|
109821
|
109822
|
109823
|
109824
|
109825
|
113054
|
113055
|
113056
|
113057
|
113058
|
114818
|
114819
|
114820
|
114821
|
114822