diff --git a/src/impl/winmd_reader/filter.h b/src/impl/winmd_reader/filter.h index 5869019..e682f35 100644 --- a/src/impl/winmd_reader/filter.h +++ b/src/impl/winmd_reader/filter.h @@ -20,7 +20,7 @@ namespace winmd::reader std::sort(m_rules.begin(), m_rules.end(), [](auto const& lhs, auto const& rhs) { - return std::pair{ lhs.first.size(), lhs.second } > std::pair{ rhs.first.size(), rhs.second }; + return std::pair{ lhs.first.size(), !lhs.second } > std::pair{ rhs.first.size(), !rhs.second }; }); } diff --git a/test/filter.cpp b/test/filter.cpp index 457921a..3200a40 100644 --- a/test/filter.cpp +++ b/test/filter.cpp @@ -38,3 +38,15 @@ TEST_CASE("filter_excludes_same_length") REQUIRE(!f.includes("N.N3.T")); REQUIRE(!f.includes("N.N4.T")); } + +TEST_CASE("filter_exclude_include_precedence") +{ + std::vector include = { "N.T" }; + std::vector exclude = { "N.T" }; + + filter f{ include, exclude }; + + REQUIRE(!f.empty()); + + REQUIRE(!f.includes("N.T")); +}