From 3e5ea114523b29bd36688f33d6cb3012756cfd8b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sun, 4 Jan 2015 11:14:58 -0300 Subject: [PATCH] Bug 13167: (QA followup) regression tests Signed-off-by: Tomas Cohen Arazi --- t/Koha.t | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/t/Koha.t b/t/Koha.t index 31365e6..18dacd6 100755 --- a/t/Koha.t +++ b/t/Koha.t @@ -1,9 +1,24 @@ #!/usr/bin/perl -use strict; -use warnings; + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; use C4::Context; -use Test::More tests => 16; +use Test::More tests => 18; use Test::MockModule; use DBD::Mock; @@ -74,5 +89,13 @@ eval { }; ok($@ eq '', 'NormalizeISBN does not throw exception when parsing invalid ISBN (bug 12243)'); +eval { + $isbn = C4::Koha::NormalizeISBN({ isbn => '979-10-90085-00-8', format => 'ISBN-10', strip_hyphens => 1 }); +}; +ok($@ eq '', 'NormalizeISBN does not throw exception when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); +ok(!defined $isbn, 'NormalizeISBN returns undef when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); + @isbns = GetVariationsOfISBNs('abc'); is(scalar(@isbns), 0, 'zero variations returned of invalid ISBN'); + +1; -- 1.9.1