MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/coding/coding_tests/diff_test.cpp:18–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using namespace std;
17
18UNIT_TEST(MyersSimpleDiff)
19{
20 vector<char> tmp;
21 PushBackByteSink<vector<char>> sink(tmp);
22 TEST_EQUAL(4, diff::DiffMyersSimple(string("axxxb"), string("cxxxd"), 5, sink), ());
23 TEST_EQUAL(5, diff::DiffMyersSimple(string("abcabba"), string("cbabac"), 10, sink), ());
24 TEST_EQUAL(5, diff::DiffMyersSimple(string("abcabba"), string("cbabac"), 5, sink), ());
25 TEST_EQUAL(-1, diff::DiffMyersSimple(string("abcabba"), string("cbabac"), 4, sink), ());
26 TEST_EQUAL(-1, diff::DiffMyersSimple(string("abcabba"), string("cbabac"), 2, sink), ());
27 TEST_EQUAL(-1, diff::DiffMyersSimple(string("abcabba"), string("cbabac"), 1, sink), ());
28}
29
30class TestPatchWriter
31{

Callers

nothing calls this directly

Calls 9

DiffMyersSimpleFunction · 0.85
CopyMethod · 0.45
InsertMethod · 0.45
FinalizeMethod · 0.45
StrMethod · 0.45
DeleteMethod · 0.45
DiffMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected