|
Lines 187-193
subtest '_split_query() tests' => sub {
Link Here
|
| 187 |
}; |
187 |
}; |
| 188 |
|
188 |
|
| 189 |
subtest '_clean_search_term() tests' => sub { |
189 |
subtest '_clean_search_term() tests' => sub { |
| 190 |
plan tests => 10; |
190 |
plan tests => 11; |
| 191 |
|
191 |
|
| 192 |
my $qb; |
192 |
my $qb; |
| 193 |
ok( |
193 |
ok( |
|
Lines 208-217
subtest '_clean_search_term() tests' => sub {
Link Here
|
| 208 |
is($res, ' unbalanced quotes ', 'unbalanced quotes removed'); |
208 |
is($res, ' unbalanced quotes ', 'unbalanced quotes removed'); |
| 209 |
|
209 |
|
| 210 |
$res = $qb->_clean_search_term('test : query'); |
210 |
$res = $qb->_clean_search_term('test : query'); |
| 211 |
is($res, 'test query', 'dangling colon removed'); |
211 |
is($res, 'test query', 'dangling colon removed'); |
| 212 |
|
212 |
|
| 213 |
$res = $qb->_clean_search_term('test :: query'); |
213 |
$res = $qb->_clean_search_term('test :: query'); |
| 214 |
is($res, 'test query', 'dangling double colon removed'); |
214 |
is($res, 'test query', 'dangling double colon removed'); |
| 215 |
|
215 |
|
| 216 |
$res = $qb->_clean_search_term('test "another : query"'); |
216 |
$res = $qb->_clean_search_term('test "another : query"'); |
| 217 |
is($res, 'test "another : query"', 'quoted dangling colon not removed'); |
217 |
is($res, 'test "another : query"', 'quoted dangling colon not removed'); |
|
Lines 221-226
subtest '_clean_search_term() tests' => sub {
Link Here
|
| 221 |
|
221 |
|
| 222 |
$res = $qb->_clean_search_term('test {another part'); |
222 |
$res = $qb->_clean_search_term('test {another part'); |
| 223 |
is($res, 'test another part', 'unbalanced curly brackets replaced correctly'); |
223 |
is($res, 'test another part', 'unbalanced curly brackets replaced correctly'); |
|
|
224 |
|
| 225 |
$res = $qb->_clean_search_term('ti:test AND kw:test'); |
| 226 |
is($res, 'title:test AND test', 'ti converted to title, kw converted to empty string, dangling colon removed with space preserved'); |
| 224 |
}; |
227 |
}; |
| 225 |
|
228 |
|
| 226 |
subtest '_join_queries' => sub { |
229 |
subtest '_join_queries' => sub { |
| 227 |
- |
|
|