// // Copyright (C) 2019 Greg Landrum // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do // this in one cpp file #include "catch.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace RDKit; TEST_CASE("SKIP_IF_ALL_MATCH") { auto m = "[Na+].[Cl-]"_smiles; REQUIRE(m); SECTION("default") { MolStandardize::FragmentRemover fragRemover; std::unique_ptr outm(fragRemover.remove(*m)); REQUIRE(outm); CHECK(MolToSmiles(*outm) == "[Na+]"); } SECTION("don't remove all") { MolStandardize::FragmentRemover fragRemover("", true, true); std::unique_ptr outm(fragRemover.remove(*m)); REQUIRE(outm); CHECK(MolToSmiles(*outm) == "[Cl-].[Na+]"); } SECTION("feel free to remove everything") { MolStandardize::FragmentRemover fragRemover("", false, false); std::unique_ptr outm(fragRemover.remove(*m)); REQUIRE(outm); CHECK(outm->getNumAtoms() == 0); } SECTION("don't remove all 2") { MolStandardize::FragmentRemover fragRemover("", true, true); auto m = "[Na+].[Cl-].[Na+].[Cl-]"_smiles; REQUIRE(m); std::unique_ptr outm(fragRemover.remove(*m)); REQUIRE(outm); CHECK(MolToSmiles(*outm) == "[Cl-].[Cl-].[Na+].[Na+]"); } }