Skip to content

Commit

Permalink
Added unit test to confirm and check for bug 2898032
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarshi committed Nov 15, 2009
1 parent dfb2805 commit 924b563
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/org/openscience/cdk/smiles/SmilesGeneratorTest.java
Expand Up @@ -890,6 +890,25 @@ public void testBug2781199() throws InvalidSmilesException {
String genSmiles = smilesGenerator.createSMILES(mol);
Assert.assertTrue("Generated SMILES should not have explicit H: "+genSmiles, genSmiles.indexOf("H") == -1);
}

/**
* @cdk.bug 2898032
*/
@Test
public void testCanSmi() throws InvalidSmilesException {
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
String s1 = "OC(=O)C(Br)(Cl)N";
String s2 = "ClC(Br)(N)C(=O)O";

IMolecule m1 = sp.parseSmiles(s1);
IMolecule m2 = sp.parseSmiles(s2);

SmilesGenerator sg = new SmilesGenerator();
String o1 = sg.createSMILES(m1);
String o2 = sg.createSMILES(m2);

Assert.assertTrue("The two canonical SMILES should match",o1.equals(o2));
}

}

0 comments on commit 924b563

Please sign in to comment.