5 TEST_CASE(TestCaseHunk
);
10 text
.addLine(new QString("Line1"));
11 text
.addLine(new QString("Line2"));
12 text
.addLine(new QString("Line3"));
13 text
.addLine(new QString("Line4"));
14 text
.addLine(new QString("Line5"));
16 text2
.addLine(new QString("L1"));
17 text2
.addLine(new QString("L2"));
18 text2
.addLine(new QString("L3"));
19 text2
.addLine(new QString("L4"));
20 text2
.addLine(new QString("L5"));
23 void testConstructors()
30 assertEquals(hunk
.originalBeginsAt(), hunk2
.originalBeginsAt());
31 assertEquals(hunk
.modifiedBeginsAt(), hunk3
.modifiedBeginsAt());
38 hunk
.addSnippet(new Context(new Text(text
)));
39 hunk
.addSnippet(new Added(new Text(text2
)));
40 hunk
.addSnippet(new Changed(new Text(text
), new Text(text2
)));
42 Hunk::iterator it
= hunk
.begin();
43 Hunk::iterator it_end
= hunk
.end();
44 assertEquals((*it
).original(), Context(new Text(text
)).original());
45 assertEquals((*it
).modified(), Context(new Text(text
)).modified());
49 assertEquals((*it
).original(), Changed(new Text(text
), new Text(text2
)).original());
50 assertEquals((*it
).modified(), Changed(new Text(text
), new Text(text2
)).modified());
52 assertEquals(hunk
.numSnippets(), 3);
56 REG_TEST(testConstructors
);
57 REG_TEST(testIterators
);