From ff872cdba7bfa851913fb9be5853408e00a786fa Mon Sep 17 00:00:00 2001 From: Greg Landrum Date: Sun, 9 Nov 2014 11:47:46 +0100 Subject: [PATCH] add test for #378 --- Code/GraphMol/SmilesParse/test.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Code/GraphMol/SmilesParse/test.cpp b/Code/GraphMol/SmilesParse/test.cpp index dd507d898..8e6dc6273 100644 --- a/Code/GraphMol/SmilesParse/test.cpp +++ b/Code/GraphMol/SmilesParse/test.cpp @@ -3404,7 +3404,27 @@ void testGithub298(){ TEST_ASSERT(m); TEST_ASSERT(m->getNumAtoms()==80); TEST_ASSERT(m->getNumBonds()==210); - + delete m; + } + BOOST_LOG(rdInfoLog) << "done" << std::endl; +} + +void testGithub378(){ + BOOST_LOG(rdInfoLog) << "-------------------------------------" << std::endl; + BOOST_LOG(rdInfoLog) << "Testing Github 378: SMILES parser doing the wrong thing for odd dot-disconnected construct" << std::endl; + { + RWMol *m; + std::string smiles="C1.C1CO1.N1"; + m = SmilesToMol(smiles); + TEST_ASSERT(m); + TEST_ASSERT(m->getBondBetweenAtoms(0,1)); + TEST_ASSERT(m->getBondBetweenAtoms(0,1)->getBondType()==Bond::SINGLE); + delete m; + TEST_ASSERT(m->getBondBetweenAtoms(3,4)); + TEST_ASSERT(m->getBondBetweenAtoms(3,4)->getBondType()==Bond::SINGLE); + TEST_ASSERT(!m->getBondBetweenAtoms(1,3)); + + } BOOST_LOG(rdInfoLog) << "done" << std::endl; } @@ -3465,5 +3485,6 @@ main(int argc, char *argv[]) testGithub210(); #endif testGithub298(); + testGithub378(); //testBug1719046(); }