Bugzilla – Attachment 42910 Details for
Bug 14909
Warnings from search_utf8.t when empty idx= misses in returned base
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14909: Warnings from search_utf8.t when empty idx= misses in base
Bug-14909-Warnings-from-searchutf8t-when-empty-idx.patch (text/plain), 2.68 KB, created by
Jonathan Druart
on 2015-09-28 11:26:56 UTC
(
hide
)
Description:
Bug 14909: Warnings from search_utf8.t when empty idx= misses in base
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-09-28 11:26:56 UTC
Size:
2.68 KB
patch
obsolete
>From e133f68dcd53aa10f9b25dc9ce1b7c8df2c64ab3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 Sep 2015 12:17:39 +0200 >Subject: [PATCH] Bug 14909: Warnings from search_utf8.t when empty idx= misses > in base > >The regex in this test looks like: > opac-search.pl\?idx=&q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1 >The result it got was: > opac-search.pl?q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1 > >The empty idx should not be a reason to fail the test. I changed the >original regex to make the 'idx=&' part optional and added a base_unlike >test to verify that the base does not include a idx=\w+ anywhere. > >Also corrected the typo Goog. Good! > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >All 66 tests now pass with me. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/www/search_utf8.t | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/www/search_utf8.t b/t/db_dependent/www/search_utf8.t >index 6229254..a8fd335 100644 >--- a/t/db_dependent/www/search_utf8.t >+++ b/t/db_dependent/www/search_utf8.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use utf8; >-use Test::More tests => 64; >+use Test::More tests => 66; > use Test::WWW::Mechanize; > use Data::Dumper; > use XML::Simple; >@@ -249,7 +249,7 @@ sub test_search{ > my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8( $publisher ); > $agent->base_like(qr|$expected_base|, ); > >- ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Goog') ; >+ ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ; > ok ($intra_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); > # -------------------------------------------------- TEST ON OPAC > >@@ -269,10 +269,14 @@ sub test_search{ > $opac_text = $agent->text(); > > like( $opac_text, qr|Publisher: $publisher|, ); >- $expected_base = q|opac-search.pl\?idx=&q=| . uri_escape_utf8( $publisher ); >+ $expected_base = q|opac-search.pl\?(idx=&)?q=| . uri_escape_utf8( $publisher ); > $agent->base_like(qr|$expected_base|, ); >+ # Test added on BZ 14909 in addition to making the empty idx= optional >+ # in the previous regex >+ $agent->base_unlike( qr|idx=\w+|, 'Base does not contain an idx' ); >+ > >- ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Goog') ; >+ ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Good') ; > ok ($opac_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); > > #-------------------------------------------------- REVERT >-- >2.1.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 14909
:
42907
| 42910