24#include <boost/test/unit_test.hpp>
35ITEM_CHANGE MakeChange(
const wxString& aType,
CHANGE_KIND aKind, std::optional<wxString> aRefdes = std::nullopt )
41 c.
refdes = std::move( aRefdes );
46std::array<bool, CATEGORY_COUNT> AllVisible()
48 std::array<bool, CATEGORY_COUNT> out{};
155 diff.
changes.push_back( std::move( fp ) );
173 diff.
docType = wxS(
"pretty" );
177 diff.
changes.push_back( std::move( fp ) );
182 BOOST_CHECK( *groups[0].entries[0].change->refdes == wxS(
"R_0402" ) );
197 BOOST_CHECK( groups[0].entries[0].itemLabel == wxS(
"NET [GND]" ) );
198 BOOST_CHECK( groups[0].entries[1].itemLabel == wxS(
"NET [Net-(U1-Pad1)]" ) );
210 BOOST_CHECK( groups[0].entries[0].itemLabel == wxS(
"FOOTPRINT [U7]" ) );
221 BOOST_CHECK( groups[0].entries[0].itemLabel == wxS(
"ZONE" ) );
232 std::array<bool, CATEGORY_COUNT> visible{};
233 visible.fill(
true );
234 visible[
static_cast<std::size_t
>( CATEGORY::ADDED )] =
false;
250 std::array<bool, CATEGORY_COUNT> visible{};
251 visible.fill(
true );
252 visible[
static_cast<std::size_t
>( CATEGORY::CONFLICT )] =
false;
271 BOOST_CHECK( groups[0].entries[0].change->typeName == wxS(
"PCB_TRACK" ) );
300 BOOST_CHECK( groups[0].groupLabel.EndsWith( wxS(
"(3)" ) ) );
314 BOOST_CHECK( groups[0].groupLabel.EndsWith( wxS(
"(1/3)" ) ) );
328 BOOST_CHECK( groups[0].groupLabel.EndsWith( wxS(
"(2)" ) ) );
CHANGE_KIND
Coarse classification of a single item-level change between two documents.
bool ChangeMatchesSearchFilter(const ITEM_CHANGE &aChange, const wxString &aLowercaseFilter)
Predicate: does this item change match the active search filter?
std::vector< CHANGE_TREE_GROUP > BuildChangeTreeGroups(const DOCUMENT_DIFF &aDiff, const wxString &aSearchFilter, const std::array< bool, CATEGORY_COUNT > &aVisibleCategories)
Group the changes in a DOCUMENT_DIFF by kind, apply category and search filters, and return the resul...
wxString ChangeKindLabel(CHANGE_KIND aKind)
Human-readable label for a CHANGE_KIND (e.g.
_OUT_STRING AsString(const std::string &aString)
The full set of changes between two parsed documents of one type.
std::vector< ITEM_CHANGE > changes
One change record on a single item.
std::optional< wxString > refdes
std::vector< ITEM_CHANGE > children
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_CASE(ChangeKindLabel_AllKinds)
BOOST_AUTO_TEST_SUITE_END()