~jpakkane/libcolumbus/hud-rework

« back to all changes in this revision

Viewing changes to test/MatcherTest.cc

  • Committer: Jussi Pakkanen
  • Date: 2014-02-28 14:26:31 UTC
  • Revision ID: jussi.pakkanen@canonical.com-20140228142631-q8rqohi4g9fc68e1
Some test cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
 
267
267
void testPerfect() {
268
268
    Corpus c;
269
 
    DocumentID correct = 1;
270
 
    DocumentID wrong = 0;
271
 
    Document d1(wrong);
 
269
    DocumentID correct = 0;
 
270
    Document d1(1);
272
271
    Document d2(correct);
 
272
    Document d3(2);
 
273
    Document d4(3);
273
274
    Word fieldName("name");
274
275
    Matcher m;
275
276
    MatchResults matches;
276
277
    WordList q = splitToWords("save");
277
278
    d1.addText(fieldName, "Save as");
278
279
    d2.addText(fieldName, "Save");
 
280
    d3.addText(fieldName, "Save yourself");
 
281
    d4.addText(fieldName, "Save the whales");
279
282
    c.addDocument(d1);
280
283
    c.addDocument(d2);
 
284
    c.addDocument(d3);
 
285
    c.addDocument(d4);
281
286
 
282
287
    m.index(c);
283
288
    matches = m.onlineMatch(q, fieldName);