fix and test issue 35525671

This commit is contained in:
Greg Landrum
2012-05-11 07:13:45 +00:00
parent f2bc7f77d2
commit 8ffcfd7149
2 changed files with 11 additions and 2 deletions

View File

@@ -64,9 +64,9 @@ namespace RDKit{
bool nonStandard;
nonStandard = std::find(defaultVs.begin(),defaultVs.end(),
totalValence)==defaultVs.end();
// another type of "nonstandard" valence is an aromatic N with
// another type of "nonstandard" valence is an aromatic N or P with
// explicit Hs indicated:
if(num==7 && atom->getIsAromatic() && atom->getNumExplicitHs()){
if((num==7||num==15) && atom->getIsAromatic() && atom->getNumExplicitHs()){
nonStandard=true;
}

View File

@@ -1726,8 +1726,17 @@ void testBug1719046(){
smi = MolToSmiles(*mol,false,false,-1);
TEST_ASSERT(smi=="c1cc[nH]c1");
delete mol;
// this was Issue 35525671
smi="P1C=CC=C1";
mol = SmilesToMol(smi);
TEST_ASSERT(mol);
smi = MolToSmiles(*mol,false,false,-1);
TEST_ASSERT(smi=="c1cc[pH]c1");
delete mol;
BOOST_LOG(rdInfoLog) << "\tdone" << std::endl;
}
void testBug1842174(){