xapian-core  1.4.25
Classes | Functions
api_snippets.cc File Reference

tests snippets More...

#include <config.h>
#include "api_snippets.h"
#include <fstream>
#include <string>
#include <xapian.h>
#include "apitest.h"
#include "testsuite.h"
#include "testutils.h"
+ Include dependency graph for api_snippets.cc:

Go to the source code of this file.

Classes

struct  snippet_testcase
 

Functions

 DEFINE_TESTCASE (snippet1, backend)
 Test snippets without stemming. More...
 
 DEFINE_TESTCASE (snippetstem1, backend)
 Test snippets with stemming. More...
 
 DEFINE_TESTCASE (snippetphrase1, backend)
 Test snippets with phrases. More...
 
static void make_tg_db (Xapian::WritableDatabase &db, const string &source)
 Index file to a DB with TermGenerator. More...
 
 DEFINE_TESTCASE (snippetmisc1, backend)
 Test snippets in various ways. More...
 
 DEFINE_TESTCASE (snippet_termcover1, backend)
 Test snippet term diversity. More...
 
 DEFINE_TESTCASE (snippet_termcover2, backend)
 Test snippet term diversity cases with BoolWeight. More...
 
 DEFINE_TESTCASE (snippet_empty, backend)
 Test snippet EMPTY_WITHOUT_MATCH flag. More...
 
 DEFINE_TESTCASE (snippet_start_nonspace, backend)
 Check snippets include certain preceding punctuation. More...
 
 DEFINE_TESTCASE (snippet_small_zerolength, backend)
 Test snippets with small and zero length. More...
 
 DEFINE_TESTCASE (snippet_ngrams, backend)
 Test ngrams. More...
 
 DEFINE_TESTCASE (snippet_empty_mset, backend)
 
 DEFINE_TESTCASE (snippet_empty_mset2, !backend)
 

Detailed Description

tests snippets

Definition in file api_snippets.cc.

Function Documentation

◆ DEFINE_TESTCASE() [1/12]

DEFINE_TESTCASE ( snippet1  ,
backend   
)

◆ DEFINE_TESTCASE() [2/12]

DEFINE_TESTCASE ( snippetstem1  ,
backend   
)

◆ DEFINE_TESTCASE() [3/12]

DEFINE_TESTCASE ( snippetphrase1  ,
backend   
)

◆ DEFINE_TESTCASE() [4/12]

DEFINE_TESTCASE ( snippetmisc1  ,
backend   
)

◆ DEFINE_TESTCASE() [5/12]

DEFINE_TESTCASE ( snippet_termcover1  ,
backend   
)

◆ DEFINE_TESTCASE() [6/12]

DEFINE_TESTCASE ( snippet_termcover2  ,
backend   
)

◆ DEFINE_TESTCASE() [7/12]

DEFINE_TESTCASE ( snippet_empty  ,
backend   
)

◆ DEFINE_TESTCASE() [8/12]

DEFINE_TESTCASE ( snippet_start_nonspace  ,
backend   
)

Check snippets include certain preceding punctuation.

Definition at line 301 of file api_snippets.cc.

References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::snippet(), and TEST_STRINGS_EQUAL.

◆ DEFINE_TESTCASE() [9/12]

DEFINE_TESTCASE ( snippet_small_zerolength  ,
backend   
)

◆ DEFINE_TESTCASE() [10/12]

DEFINE_TESTCASE ( snippet_ngrams  ,
backend   
)

◆ DEFINE_TESTCASE() [11/12]

DEFINE_TESTCASE ( snippet_empty_mset  ,
backend   
)

◆ DEFINE_TESTCASE() [12/12]

DEFINE_TESTCASE ( snippet_empty_mset2  ,
backend 
)

Definition at line 528 of file api_snippets.cc.

References Xapian::MSet::snippet(), and TEST_STRINGS_EQUAL.

◆ make_tg_db()

static void make_tg_db ( Xapian::WritableDatabase db,
const string &  source 
)
static