From 5159a43d4341b03bd1b30926e33bf9c686e9fb46 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 8 Jan 2014 14:15:28 -0300 Subject: [PATCH] Bug 11096: Wrap each test set configuration in Search.t into a subtest This makes it easier to read. Also fixes the test count, and is rebased against 11499 which is needed to correctly test the patches for this bug (i.e. indexing mode needs to be correctly set in koha-conf.xml) To test: [1] Run prove -v t/db_dependent/Search.t Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Chris Cormack Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Galen Charlton --- t/db_dependent/Search.t | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 3fbea3057f..415cb7558c 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -12,7 +12,10 @@ use YAML; use C4::Debug; require C4::Context; -use Test::More tests => 232; +# work around spurious wide character warnings +use open ':std', ':encoding(utf8)'; + +use Test::More tests => 4; use Test::MockModule; use MARC::Record; use File::Spec; @@ -23,10 +26,6 @@ use File::Temp qw/ tempdir /; use File::Path; use DBI; -# work around spurious wide character warnings -binmode Test::More->builder->output, ":utf8"; -binmode Test::More->builder->failure_output, ":utf8"; - our $child; our $datadir; @@ -788,12 +787,12 @@ sub run_marc21_search_tests { # retrieve records that are larger than the MARC limit of 99,999 octets ( undef, $results_hashref, $facets_loop ) = getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); - is($results_hashref->{biblioserver}->{hits}, 1, "can do a search that retrieves an over-large bib record (bug 11096)"); + is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); @newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); - is($newresults[0]->{title}, 'Marc the Large Record', 'able to render over-large bib record (bug 11096)'); - is($newresults[0]->{biblionumber}, '300', 'able to render over-large bib record (bug 11096)'); - like($newresults[0]->{notes}, qr/This is large note #550/, 'able to render over-large bib record (bug 11096)'); + is($newresults[0]->{title}, 'Marc the Large Record', 'Able to render the title for over-large bib record (bug 11096)'); + is($newresults[0]->{biblionumber}, '300', 'Over-large bib record has the correct biblionumber (bug 11096)'); + like($newresults[0]->{notes}, qr/This is large note #550/, 'Able to render the notes field for over-large bib record (bug 11096)'); cleanup(); } @@ -869,10 +868,24 @@ sub run_unimarc_search_tests { cleanup(); } -run_marc21_search_tests('grs1'); -run_marc21_search_tests('dom'); - -run_unimarc_search_tests('grs1'); -run_unimarc_search_tests('dom'); +subtest 'MARC21 + GRS-1' => sub { + plan tests => 103; + run_marc21_search_tests('grs1'); +}; + +subtest 'MARC21 + DOM' => sub { + plan tests => 103; + run_marc21_search_tests('dom'); +}; + +subtest 'UNIMARC + GRS-1' => sub { + plan tests => 13; + run_unimarc_search_tests('grs1'); +}; + +subtest 'UNIMARC + DOM' => sub { + plan tests => 13; + run_unimarc_search_tests('dom'); +}; 1; -- 2.39.5