Skip to content

Commit

Permalink
Added a unit test for the double brackets SMILES bug
Browse files Browse the repository at this point in the history
Change-Id: Ib956b78ba268c2ab8f452e70e4c0b619a5e774aa
Signed-off-by: John May <john.wilkinsonmay@gmail.com>
  • Loading branch information
egonw authored and johnmay committed Jun 3, 2013
1 parent 3f48463 commit 8abc4a0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/org/openscience/cdk/smiles/SmilesGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,21 @@ private void fixCarbonHCount(IAtomContainer mol) {
String smiles = smilesGenerator.createSMILES(mol);
Assert.assertTrue(smiles.indexOf("[nH]") >= 0);
}

/**
* @cdk.bug 1300
*/
@Test public void testDoubleBracketProblem() throws Exception {
IAtomContainer mol = MoleculeFactory.makePyrrole();
mol.getAtom(1).setFormalCharge(-1);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
CDKHueckelAromaticityDetector.detectAromaticity(mol);

SmilesGenerator smilesGenerator = new SmilesGenerator();
smilesGenerator.setUseAromaticityFlag(true);
String smiles = smilesGenerator.createSMILES(mol);
Assert.assertFalse(smiles.contains("[[nH]-]"));
}

/**
* @cdk.bug 2051597
Expand Down

0 comments on commit 8abc4a0

Please sign in to comment.