2 * @brief tests which don't use any of the backends
4 /* Copyright 1999,2000,2001 BrightStation PLC
5 * Copyright 2002 Ananova Ltd
6 * Copyright 2002,2003,2004,2005,2006,2007,2008,2009,2010,2015,2016,2017,2019 Olly Betts
7 * Copyright 2006 Lemur Consulting Ltd
8 * Copyright (C) 2016 Vivek Pal
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
33 #include "testsuite.h"
34 #include "testutils.h"
43 DEFINE_TESTCASE(trivial1
, !backend
) {
46 // tests that get_query_terms() returns the terms in the right order
47 DEFINE_TESTCASE(getqterms1
, !backend
) {
48 list
<string
> answers_list
;
49 answers_list
.push_back("one");
50 answers_list
.push_back("two");
51 answers_list
.push_back("three");
52 answers_list
.push_back("four");
54 Xapian::Query
myquery(Xapian::Query::OP_OR
,
55 Xapian::Query(Xapian::Query::OP_AND
,
56 Xapian::Query("one", 1, 1),
57 Xapian::Query("three", 1, 3)),
58 Xapian::Query(Xapian::Query::OP_OR
,
59 Xapian::Query("four", 1, 4),
60 Xapian::Query("two", 1, 2)));
64 Xapian::TermIterator t
;
65 for (t
= myquery
.get_terms_begin(); t
!= myquery
.get_terms_end(); ++t
)
68 TEST(list1
== answers_list
);
69 list
<string
> list2(myquery
.get_terms_begin(), myquery
.get_terms_end());
70 TEST(list2
== answers_list
);
73 // tests that get_query_terms() doesn't SEGV on an empty query
74 // (regression test for bug in 0.9.0)
75 DEFINE_TESTCASE(getqterms2
, !backend
) {
76 Xapian::Query empty_query
;
77 TEST_EQUAL(empty_query
.get_terms_begin(), empty_query
.get_terms_end());
78 TEST_EQUAL(empty_query
.get_unique_terms_begin(),
79 empty_query
.get_unique_terms_end());
82 // tests that empty queries work correctly
83 DEFINE_TESTCASE(emptyquery2
, !backend
) {
84 // test that Query::empty() is true for an empty query.
85 TEST(Xapian::Query().empty());
86 // test that an empty query has length 0
87 TEST(Xapian::Query().get_length() == 0);
88 vector
<Xapian::Query
> v
;
89 TEST(Xapian::Query(Xapian::Query::OP_OR
, v
.begin(), v
.end()).empty());
90 TEST(Xapian::Query(Xapian::Query::OP_OR
, v
.begin(), v
.end()).get_length() == 0);
93 /// Regression test for behaviour for an empty query with AND_NOT.
94 DEFINE_TESTCASE(emptyquery3
, !backend
) {
95 static const Xapian::Query::op ops
[] = {
96 Xapian::Query::OP_AND
,
98 Xapian::Query::OP_XOR
,
99 Xapian::Query::OP_AND_MAYBE
,
100 Xapian::Query::OP_AND_NOT
103 for (size_t i
= 0; i
< sizeof(ops
) / sizeof(ops
[0]); ++i
) {
104 tout
<< "Testing op #" << i
<< endl
;
106 Xapian::Query
q("test");
107 Xapian::Query
qcombine(ops
[i
], empty
, q
);
108 tout
<< qcombine
.get_description() << endl
;
109 Xapian::Query
qcombine2(ops
[i
], q
, empty
);
110 tout
<< qcombine2
.get_description() << endl
;
111 Xapian::Query
qcombine3(ops
[i
], empty
, empty
);
112 tout
<< qcombine3
.get_description() << endl
;
116 // tests that query lengths are calculated correctly
117 DEFINE_TESTCASE(querylen1
, !backend
) {
118 // test that a simple query has the right length
119 Xapian::Query myquery
;
120 myquery
= Xapian::Query(Xapian::Query::OP_OR
,
121 Xapian::Query("foo"),
122 Xapian::Query("bar"));
123 myquery
= Xapian::Query(Xapian::Query::OP_AND
,
125 Xapian::Query(Xapian::Query::OP_OR
,
126 Xapian::Query("wibble"),
127 Xapian::Query("spoon")));
129 TEST_EQUAL(myquery
.get_length(), 4);
130 TEST(!myquery
.empty());
133 // tests that query lengths are calculated correctly
134 DEFINE_TESTCASE(querylen2
, !backend
) {
135 // test with an even bigger and strange query
141 Xapian::Query queries
[3] = {
142 Xapian::Query("wibble"),
143 Xapian::Query("wobble"),
144 Xapian::Query(Xapian::Query::OP_OR
, string("jelly"), string("belly"))
147 Xapian::Query myquery
;
148 vector
<string
> v1(terms
, terms
+ 3);
149 vector
<Xapian::Query
> v2(queries
, queries
+ 3);
150 vector
<Xapian::Query
*> v3
;
151 Xapian::Query
query1(Xapian::Query::OP_AND
, string("ball"), string("club"));
152 Xapian::Query
query2("ring");
153 v3
.push_back(&query1
);
154 v3
.push_back(&query2
);
156 Xapian::Query myq1
= Xapian::Query(Xapian::Query::OP_AND
, v1
.begin(), v1
.end());
157 tout
<< "myq1=" << myq1
<< "\n";
158 TEST_EQUAL(myq1
.get_length(), 3);
160 Xapian::Query myq2_1
= Xapian::Query(Xapian::Query::OP_OR
, v2
.begin(), v2
.end());
161 tout
<< "myq2_1=" << myq2_1
<< "\n";
162 TEST_EQUAL(myq2_1
.get_length(), 4);
164 Xapian::Query myq2_2
= Xapian::Query(Xapian::Query::OP_AND
, v3
.begin(), v3
.end());
165 tout
<< "myq2_2=" << myq2_2
<< "\n";
166 TEST_EQUAL(myq2_2
.get_length(), 3);
168 Xapian::Query myq2
= Xapian::Query(Xapian::Query::OP_OR
, myq2_1
, myq2_2
);
169 tout
<< "myq2=" << myq2
<< "\n";
170 TEST_EQUAL(myq2
.get_length(), 7);
172 myquery
= Xapian::Query(Xapian::Query::OP_OR
, myq1
, myq2
);
173 tout
<< "myquery=" << myquery
<< "\n";
174 TEST_EQUAL(myquery
.get_length(), 10);
177 // tests that queries validate correctly
178 DEFINE_TESTCASE(queryvalid1
, !backend
) {
179 Xapian::Query
q2(Xapian::Query::OP_XOR
, Xapian::Query("foo"), Xapian::Query("bar"));
180 tout
<< "XOR (\"foo\", \"bar\") checked" << endl
;
183 /** Check we no longer flatten subqueries combined with the same operator.
185 * Prior to 1.3.0 we did flatten these, but it's simpler to just handle this
186 * when we convert the query to a PostList tree, and that works better with
187 * Query objects being immutable.
189 DEFINE_TESTCASE(dontflattensubqueries1
, !backend
) {
190 Xapian::Query queries1
[3] = {
191 Xapian::Query("wibble"),
192 Xapian::Query("wobble"),
193 Xapian::Query(Xapian::Query::OP_OR
, string("jelly"), string("belly"))
196 Xapian::Query queries2
[3] = {
197 Xapian::Query(Xapian::Query::OP_AND
, string("jelly"), string("belly")),
198 Xapian::Query("wibble"),
199 Xapian::Query("wobble")
202 vector
<Xapian::Query
> vec1(queries1
, queries1
+ 3);
203 Xapian::Query
myquery1(Xapian::Query::OP_OR
, vec1
.begin(), vec1
.end());
204 TEST_EQUAL(myquery1
.get_description(),
205 "Query((wibble OR wobble OR (jelly OR belly)))");
207 vector
<Xapian::Query
> vec2(queries2
, queries2
+ 3);
208 Xapian::Query
myquery2(Xapian::Query::OP_AND
, vec2
.begin(), vec2
.end());
209 TEST_EQUAL(myquery2
.get_description(),
210 "Query(((jelly AND belly) AND wibble AND wobble))");
213 // test behaviour when creating a query from an empty vector
214 DEFINE_TESTCASE(emptyquerypart1
, !backend
) {
215 vector
<string
> emptyterms
;
216 Xapian::Query
query(Xapian::Query::OP_OR
, emptyterms
.begin(), emptyterms
.end());
217 TEST(Xapian::Query(Xapian::Query::OP_AND
, query
, Xapian::Query("x")).empty());
218 TEST(Xapian::Query(Xapian::Query::OP_AND
, query
, Xapian::Query("x")).get_length() == 0);
219 TEST(!Xapian::Query(Xapian::Query::OP_OR
, query
, Xapian::Query("x")).empty());
220 TEST(Xapian::Query(Xapian::Query::OP_OR
, query
, Xapian::Query("x")).get_length() == 1);
223 DEFINE_TESTCASE(stemlangs1
, !backend
) {
224 string langs
= Xapian::Stem::get_available_languages();
225 tout
<< "available languages '" << langs
<< "'" << endl
;
226 TEST(!langs
.empty());
228 // Also test the language codes.
229 langs
+= " ar hy eu ca da nl en fi fr de hu id ga it lt ne nb nn no pt ro"
232 string::size_type i
= 0;
234 string::size_type spc
= langs
.find(' ', i
);
235 // The only spaces in langs should be a single one between each pair
236 // of language names.
237 TEST_NOT_EQUAL(i
, spc
);
239 // Try making a stemmer for this language. We should be able to create
240 // it without an exception being thrown.
241 string
language(langs
, i
, spc
- i
);
242 tout
<< "checking language code '" << language
<< "' works" << endl
;
243 Xapian::Stem
stemmer(language
);
244 TEST(!stemmer
.is_none());
245 if (language
.size() > 2) {
246 string
expected("Xapian::Stem(");
247 expected
+= language
;
249 TEST_EQUAL(stemmer
.get_description(), expected
);
252 if (spc
== string::npos
) break;
257 // Stem("none") should give a no-op stemmer.
258 Xapian::Stem stem_nothing
= Xapian::Stem("none");
259 TEST(stem_nothing
.is_none());
260 TEST_EQUAL(stem_nothing
.get_description(), "Xapian::Stem(none)");
264 // Stem("") should be equivalent.
265 Xapian::Stem stem_nothing
= Xapian::Stem("");
266 TEST(stem_nothing
.is_none());
267 TEST_EQUAL(stem_nothing
.get_description(), "Xapian::Stem(none)");
271 // Some simple tests of the built in weighting schemes.
272 DEFINE_TESTCASE(weight1
, !backend
) {
275 Xapian::BoolWeight boolweight
;
276 TEST_EQUAL(boolweight
.name(), "Xapian::BoolWeight");
277 wt
= Xapian::BoolWeight().unserialise(boolweight
.serialise());
278 TEST_EQUAL(boolweight
.serialise(), wt
->serialise());
281 Xapian::CoordWeight coordweight
;
282 TEST_EQUAL(coordweight
.name(), "Xapian::CoordWeight");
283 wt
= Xapian::CoordWeight().unserialise(coordweight
.serialise());
284 TEST_EQUAL(coordweight
.serialise(), wt
->serialise());
287 Xapian::TradWeight tradweight_dflt
;
288 Xapian::TradWeight
tradweight(1.0);
289 TEST_EQUAL(tradweight
.name(), "Xapian::TradWeight");
290 TEST_EQUAL(tradweight_dflt
.serialise(), tradweight
.serialise());
291 wt
= Xapian::TradWeight().unserialise(tradweight
.serialise());
292 TEST_EQUAL(tradweight
.serialise(), wt
->serialise());
295 Xapian::TradWeight
tradweight2(2.0);
296 TEST_NOT_EQUAL(tradweight
.serialise(), tradweight2
.serialise());
298 Xapian::BM25Weight bm25weight_dflt
;
299 Xapian::BM25Weight
bm25weight(1, 0, 1, 0.5, 0.5);
300 TEST_EQUAL(bm25weight
.name(), "Xapian::BM25Weight");
301 TEST_EQUAL(bm25weight_dflt
.serialise(), bm25weight
.serialise());
302 wt
= Xapian::BM25Weight().unserialise(bm25weight
.serialise());
303 TEST_EQUAL(bm25weight
.serialise(), wt
->serialise());
306 Xapian::BM25Weight
bm25weight2(1, 0.5, 1, 0.5, 0.5);
307 TEST_NOT_EQUAL(bm25weight
.serialise(), bm25weight2
.serialise());
309 Xapian::BM25PlusWeight bm25plusweight_dflt
;
310 Xapian::BM25PlusWeight
bm25plusweight(1, 0, 1, 0.5, 0.5, 1.0);
311 TEST_EQUAL(bm25plusweight
.name(), "Xapian::BM25PlusWeight");
312 TEST_EQUAL(bm25plusweight_dflt
.serialise(), bm25plusweight
.serialise());
313 wt
= Xapian::BM25PlusWeight().unserialise(bm25plusweight
.serialise());
314 TEST_EQUAL(bm25plusweight
.serialise(), wt
->serialise());
317 Xapian::BM25PlusWeight
bm25plusweight2(1, 0, 1, 0.5, 0.5, 2.0);
318 TEST_NOT_EQUAL(bm25plusweight
.serialise(), bm25plusweight2
.serialise());
320 Xapian::TfIdfWeight tfidfweight_dflt
;
321 Xapian::TfIdfWeight
tfidfweight("ntn");
322 TEST_EQUAL(tfidfweight
.name(), "Xapian::TfIdfWeight");
323 TEST_EQUAL(tfidfweight_dflt
.serialise(), tfidfweight
.serialise());
324 wt
= Xapian::TfIdfWeight().unserialise(tfidfweight
.serialise());
325 TEST_EQUAL(tfidfweight
.serialise(), wt
->serialise());
328 Xapian::TfIdfWeight
tfidfweight2("bpn");
329 TEST_NOT_EQUAL(tfidfweight
.serialise(), tfidfweight2
.serialise());
331 Xapian::InL2Weight inl2weight_dflt
;
332 Xapian::InL2Weight
inl2weight(1.0);
333 TEST_EQUAL(inl2weight
.name(), "Xapian::InL2Weight");
334 TEST_EQUAL(inl2weight_dflt
.serialise(), inl2weight
.serialise());
335 wt
= Xapian::InL2Weight().unserialise(inl2weight
.serialise());
336 TEST_EQUAL(inl2weight
.serialise(), wt
->serialise());
339 Xapian::InL2Weight
inl2weight2(2.0);
340 TEST_NOT_EQUAL(inl2weight
.serialise(), inl2weight2
.serialise());
342 Xapian::IfB2Weight ifb2weight_dflt
;
343 Xapian::IfB2Weight
ifb2weight(1.0);
344 TEST_EQUAL(ifb2weight
.name(), "Xapian::IfB2Weight");
345 TEST_EQUAL(ifb2weight_dflt
.serialise(), ifb2weight
.serialise());
346 wt
= Xapian::IfB2Weight().unserialise(ifb2weight
.serialise());
347 TEST_EQUAL(ifb2weight
.serialise(), wt
->serialise());
350 Xapian::IfB2Weight
ifb2weight2(2.0);
351 TEST_NOT_EQUAL(ifb2weight
.serialise(), ifb2weight2
.serialise());
353 Xapian::IneB2Weight ineb2weight_dflt
;
354 Xapian::IneB2Weight
ineb2weight(1.0);
355 TEST_EQUAL(ineb2weight
.name(), "Xapian::IneB2Weight");
356 TEST_EQUAL(ineb2weight_dflt
.serialise(), ineb2weight
.serialise());
357 wt
= Xapian::IneB2Weight().unserialise(ineb2weight
.serialise());
358 TEST_EQUAL(ineb2weight
.serialise(), wt
->serialise());
361 Xapian::IneB2Weight
ineb2weight2(2.0);
362 TEST_NOT_EQUAL(ineb2weight
.serialise(), ineb2weight2
.serialise());
364 Xapian::BB2Weight bb2weight_dflt
;
365 Xapian::BB2Weight
bb2weight(1.0);
366 TEST_EQUAL(bb2weight
.name(), "Xapian::BB2Weight");
367 TEST_EQUAL(bb2weight_dflt
.serialise(), bb2weight
.serialise());
368 wt
= Xapian::BB2Weight().unserialise(bb2weight
.serialise());
369 TEST_EQUAL(bb2weight
.serialise(), wt
->serialise());
372 Xapian::BB2Weight
bb2weight2(2.0);
373 TEST_NOT_EQUAL(bb2weight
.serialise(), bb2weight2
.serialise());
375 Xapian::DLHWeight dlhweight
;
376 TEST_EQUAL(dlhweight
.name(), "Xapian::DLHWeight");
377 wt
= Xapian::DLHWeight().unserialise(dlhweight
.serialise());
378 TEST_EQUAL(dlhweight
.serialise(), wt
->serialise());
381 Xapian::PL2Weight pl2weight_dflt
;
382 Xapian::PL2Weight
pl2weight(1.0);
383 TEST_EQUAL(pl2weight
.name(), "Xapian::PL2Weight");
384 TEST_EQUAL(pl2weight_dflt
.serialise(), pl2weight
.serialise());
385 wt
= Xapian::PL2Weight().unserialise(pl2weight
.serialise());
386 TEST_EQUAL(pl2weight
.serialise(), wt
->serialise());
389 Xapian::PL2Weight
pl2weight2(2.0);
390 TEST_NOT_EQUAL(pl2weight
.serialise(), pl2weight2
.serialise());
392 Xapian::PL2PlusWeight pl2plusweight_dflt
;
393 Xapian::PL2PlusWeight
pl2plusweight(1.0, 0.8);
394 TEST_EQUAL(pl2plusweight
.name(), "Xapian::PL2PlusWeight");
395 TEST_EQUAL(pl2plusweight_dflt
.serialise(), pl2plusweight
.serialise());
396 wt
= Xapian::PL2PlusWeight().unserialise(pl2plusweight
.serialise());
397 TEST_EQUAL(pl2plusweight
.serialise(), wt
->serialise());
400 Xapian::PL2PlusWeight
pl2plusweight2(2.0, 0.9);
401 TEST_NOT_EQUAL(pl2plusweight
.serialise(), pl2plusweight2
.serialise());
403 Xapian::DPHWeight dphweight
;
404 TEST_EQUAL(dphweight
.name(), "Xapian::DPHWeight");
405 wt
= Xapian::DPHWeight().unserialise(dphweight
.serialise());
406 TEST_EQUAL(dphweight
.serialise(), wt
->serialise());
409 Xapian::LMWeight unigramlmweight_dflt
;
410 Xapian::LMWeight
unigramlmweight(32000, Xapian::Weight::DIRICHLET_SMOOTHING
, 2034.0, 0.0);
411 TEST_EQUAL(unigramlmweight
.name(), "Xapian::LMWeight");
412 TEST_NOT_EQUAL(unigramlmweight_dflt
.serialise(), unigramlmweight
.serialise());
413 wt
= Xapian::LMWeight().unserialise(unigramlmweight
.serialise());
414 TEST_EQUAL(unigramlmweight
.serialise(), wt
->serialise());
419 DEFINE_TESTCASE(nosuchdb1
, !backend
) {
420 // This is a "nodb" test because it doesn't test a particular backend.
422 Xapian::Database
db("NOsuChdaTabASe");
423 FAIL_TEST("Managed to open 'NOsuChdaTabASe'");
424 } catch (const Xapian::DatabaseOpeningError
& e
) {
425 // We don't really require this exact message, but in Xapian <= 1.1.0
426 // this gave "Couldn't detect type of database".
427 TEST_STRINGS_EQUAL(e
.get_msg(), "Couldn't stat 'NOsuChdaTabASe'");
431 Xapian::Database::check("NOsuChdaTabASe");
432 FAIL_TEST("Managed to check 'NOsuChdaTabASe'");
433 } catch (const Xapian::DatabaseOpeningError
& e
) {
434 // In 1.4.3 and earlier, this threw DatabaseError with the message:
435 // "File is not a Xapian database or database table" (confusing as
436 // there is no file).
437 TEST_STRINGS_EQUAL(e
.get_msg(),
438 "Couldn't find Xapian database or table to check");
442 // Feature tests for value manipulations.
443 DEFINE_TESTCASE(addvalue1
, !backend
) {
444 // Regression test for add_value on an existing value (bug#82).
445 Xapian::Document doc
;
446 doc
.add_value(1, "original");
447 doc
.add_value(1, "replacement");
448 TEST_EQUAL(doc
.get_value(1), "replacement");
450 doc
.add_value(2, "too");
451 doc
.add_value(3, "free");
452 doc
.add_value(4, "for");
456 TEST_EQUAL(doc
.get_value(0), "");
457 TEST_EQUAL(doc
.get_value(1), "replacement");
458 TEST_EQUAL(doc
.get_value(2), "");
459 TEST_EQUAL(doc
.get_value(3), "free");
460 TEST_EQUAL(doc
.get_value(4), "");
463 // tests that the collapsing on termpos optimisation gives correct query length
464 DEFINE_TESTCASE(poscollapse2
, !backend
) {
465 Xapian::Query
q(Xapian::Query::OP_OR
, Xapian::Query("this", 1, 1), Xapian::Query("this", 1, 1));
466 TEST_EQUAL(q
.get_length(), 2);
469 // regression test of querying an uninitialised database: should report an
470 // error; used to segfault with 1.0.0.
471 DEFINE_TESTCASE(uninitdb1
, !backend
) {
473 TEST_EXCEPTION(Xapian::InvalidArgumentError
,
474 Xapian::Enquire
enq(db
));
477 // Test a scaleweight query applied to a match nothing query
478 DEFINE_TESTCASE(scaleweight3
, !backend
) {
479 Xapian::Query
matchnothing(Xapian::Query::MatchNothing
);
480 Xapian::Query
query(Xapian::Query::OP_SCALE_WEIGHT
, matchnothing
, 3.0);
481 TEST_EQUAL(query
.get_description(), "Query()");
484 // Regression test - before 1.1.0, you could add docid 0 to an RSet.
485 DEFINE_TESTCASE(rset3
, !backend
) {
487 TEST_EXCEPTION(Xapian::InvalidArgumentError
, rset
.add_document(0));
489 TEST_EQUAL(rset
.size(), 0);
490 rset
.add_document(1);
491 rset
.add_document(static_cast<Xapian::docid
>(-1));
492 TEST_EXCEPTION(Xapian::InvalidArgumentError
, rset
.add_document(0));
494 TEST_EQUAL(rset
.size(), 2);
497 // Regression test - RSet::get_description() gave a malformed answer in 1.0.7.
498 DEFINE_TESTCASE(rset4
, !backend
) {
500 rset
.add_document(1);
501 // In 1.0.7 this gave: RSet(RSet(RSet::Internal(, 1))
502 TEST_STRINGS_EQUAL(rset
.get_description(), "RSet(RSet::Internal(1))");
505 // Direct test of ValueSetMatchDecider
506 DEFINE_TESTCASE(valuesetmatchdecider1
, !backend
) {
507 Xapian::ValueSetMatchDecider
vsmd1(0, true);
508 vsmd1
.add_value("42");
509 Xapian::ValueSetMatchDecider
vsmd2(0, false);
510 vsmd2
.remove_value("nosuch"); // Test removing a value which isn't present.
511 vsmd2
.add_value("42");
512 Xapian::ValueSetMatchDecider
vsmd3(0, true);
513 vsmd3
.add_value("42");
514 vsmd3
.add_value("blah");
516 Xapian::Document doc
;
520 doc
.add_value(0, "42");
524 doc
.add_value(0, "blah");
529 vsmd3
.remove_value("nosuch"); // Test removing a value which isn't present.
530 vsmd3
.remove_value("blah");
534 doc
.add_value(0, "42");
540 // Test that asking for the termfreq on an empty mset raises an exception.
541 DEFINE_TESTCASE(emptymset1
, !backend
) {
542 Xapian::MSet emptymset
;
543 TEST_EXCEPTION(Xapian::InvalidOperationError
,
544 emptymset
.get_termfreq("foo"));
547 DEFINE_TESTCASE(expanddeciderfilterprefix1
, !backend
) {
548 string prefix
= "tw";
549 Xapian::ExpandDeciderFilterPrefix
decider(prefix
);
550 TEST(!decider("one"));
553 TEST(!decider("Two"));
554 TEST(decider("two"));
555 TEST(decider("twitter"));
556 TEST(decider(prefix
));