69 std::vector<wxString> oldLines = { wxT(
"a" ), wxT(
"b" ), wxT(
"c" ) };
70 std::vector<wxString> inserted = { wxT(
"a" ), wxT(
"b" ), wxT(
"x" ), wxT(
"c" ) };
71 std::vector<wxString> removed = { wxT(
"a" ), wxT(
"c" ) };
94 BOOST_REQUIRE_EQUAL( unix.size(), 2 );
98 BOOST_REQUIRE_EQUAL( dos.size(), 2 );
102 BOOST_REQUIRE_EQUAL( noFinalNewline.size(), 2 );
114 std::vector<wxString> many;
115 std::vector<wxString> one = { wxT(
"only" ) };
117 for(
int ii = 0; ii < 500; ii++ )
118 many.push_back( ii == 250 ? wxString( wxT(
"only" ) ) : wxString::Format( wxT(
"line %d" ), ii ) );
123 for(
const std::vector<TEXT_DIFF_LINE>& diff : { removed, added } )
129 if( line.kind == TEXT_DIFF_KIND::CONTEXT )
179 std::vector<wxString> oldLines;
180 std::vector<wxString> newLines;
182 for(
int ii = 0; ii < 2001; ii++ )
184 oldLines.push_back( ii == 1000 ? wxString( wxT(
"shared" ) ) : wxString::Format( wxT(
"old %d" ), ii ) );
185 newLines.push_back( ii == 1000 ? wxString( wxT(
"shared" ) ) : wxString::Format( wxT(
"new %d" ), ii ) );
190 BOOST_REQUIRE_EQUAL( diff.size(), oldLines.size() + newLines.size() );
192 for(
size_t ii = 0; ii < oldLines.size(); ii++ )
195 for(
size_t ii = oldLines.size(); ii < diff.size(); ii++ )
std::vector< TEXT_DIFF_LINE > BuildTextDiff(const std::vector< wxString > &aOld, const std::vector< wxString > &aNew)
Every line of both sides appears once. There are no hunks and nothing is elided.
BOOST_AUTO_TEST_CASE(IdenticalFilesAreAllContext)
static wxString render(const std::vector< TEXT_DIFF_LINE > &aLines)
BOOST_CHECK_EQUAL(result, "25.4")