3c12d5f2f6
Patch changes the French string (with French stopwords) to an English string with English stopwords, as only English stopwords are installed in the default data. This patch will allow Search.t to run on the database attached to this bug. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
30 lines
654 B
Perl
30 lines
654 B
Perl
#!/usr/bin/perl
|
|
#
|
|
# This Koha test module is a stub!
|
|
# Add more tests here!!!
|
|
|
|
use strict;
|
|
use warnings;
|
|
use utf8;
|
|
|
|
use YAML;
|
|
|
|
use C4::Debug;
|
|
use C4::Context;
|
|
use C4::Search;
|
|
|
|
use Test::More tests => 4;
|
|
|
|
use_ok('C4::Search');
|
|
|
|
foreach my $string ("Leçon","modèles") {
|
|
my @results=C4::Search::_remove_stopwords($string,"kw");
|
|
$debug && warn "$string ",Dump(@results);
|
|
ok($results[0] eq $string,"$string is not modified");
|
|
}
|
|
|
|
foreach my $string ("A book about the stars") {
|
|
my @results=C4::Search::_remove_stopwords($string,"kw");
|
|
$debug && warn "$string ",Dump(@results);
|
|
ok($results[0] ne $string,"$results[0] from $string");
|
|
}
|