Skip to content
Snippets Groups Projects
Commit 87495932 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add string match tests

parent e3ad22bf
No related branches found
No related tags found
No related merge requests found
#include <list>
#include "stringMatchTest.h"
#include <string/LinearString.h>
#include <stringology/exact/ExactFactorMatch.h>
#define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y))
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( stringMatchTest, "string" );
CPPUNIT_TEST_SUITE_REGISTRATION( stringMatchTest );
void stringMatchTest::setUp() {
}
void stringMatchTest::tearDown() {
}
void stringMatchTest::testStringMatch() {
string::LinearString < > linear1({alphabet::symbolFrom(0), alphabet::symbolFrom(1), alphabet::symbolFrom(2), alphabet::symbolFrom(3)});
string::LinearString < > linear2({alphabet::symbolFrom(1), alphabet::symbolFrom(2), alphabet::symbolFrom(3)});
CPPUNIT_ASSERT ( stringology::exact::ExactFactorMatch::match ( linear1, linear2 ).count ( 1 ) );
}
#ifndef STRING_MATCH_TEST_H_
#define STRING_MATCH_TEST_H_
#include <cppunit/extensions/HelperMacros.h>
class stringMatchTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( stringMatchTest );
CPPUNIT_TEST( testStringMatch );
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void testStringMatch();
};
#endif // STRING_MATCH_TEST_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment