View | Details | Raw Unified | Return to bug 14909
Collapse All | Expand All

(-)a/t/db_dependent/www/search_utf8.t (-5 / +8 lines)
Lines 18-24 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use utf8;
20
use utf8;
21
use Test::More tests => 64;
21
use Test::More tests => 66;
22
use Test::WWW::Mechanize;
22
use Test::WWW::Mechanize;
23
use Data::Dumper;
23
use Data::Dumper;
24
use XML::Simple;
24
use XML::Simple;
Lines 249-255 sub test_search{ Link Here
249
    my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8( $publisher );
249
    my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8( $publisher );
250
    $agent->base_like(qr|$expected_base|, );
250
    $agent->base_like(qr|$expected_base|, );
251
251
252
    ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Goog') ;
252
    ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ;
253
    ok ($intra_text =~  $utf8_reg, 'UTF-8 chars are correctly present. Good');
253
    ok ($intra_text =~  $utf8_reg, 'UTF-8 chars are correctly present. Good');
254
    # -------------------------------------------------- TEST ON OPAC
254
    # -------------------------------------------------- TEST ON OPAC
255
255
Lines 269-278 sub test_search{ Link Here
269
    $opac_text = $agent->text();
269
    $opac_text = $agent->text();
270
270
271
    like( $opac_text, qr|Publisher: $publisher|, );
271
    like( $opac_text, qr|Publisher: $publisher|, );
272
    $expected_base = q|opac-search.pl\?idx=&q=| . uri_escape_utf8( $publisher );
272
    $expected_base = q|opac-search.pl\?(idx=&)?q=| . uri_escape_utf8( $publisher );
273
    $agent->base_like(qr|$expected_base|, );
273
    $agent->base_like(qr|$expected_base|, );
274
    # Test added on BZ 14909 in addition to making the empty idx= optional
275
    # in the previous regex
276
    $agent->base_unlike( qr|idx=\w+|, 'Base does not contain an idx' );
277
    
274
278
275
    ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Goog') ;
279
    ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Good') ;
276
    ok ($opac_text =~  $utf8_reg, 'UTF-8 chars are correctly present. Good');
280
    ok ($opac_text =~  $utf8_reg, 'UTF-8 chars are correctly present. Good');
277
281
278
    #-------------------------------------------------- REVERT
282
    #-------------------------------------------------- REVERT
279
- 

Return to bug 14909