Skip to content

Commit

Permalink
Implemented test for conversion of SMILES with a topological chiral c…
Browse files Browse the repository at this point in the history
…entre.

Change-Id: I7703e9c2ca89baa4f3c55ab8b7b58f465510a12b
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Sep 24, 2012
1 parent 3c0d36b commit bd922f6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/org/openscience/cdk/inchi/InChIGeneratorFactoryTest.java
Expand Up @@ -34,6 +34,9 @@
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IStereoElement;
import org.openscience.cdk.interfaces.ITetrahedralChirality;
import org.openscience.cdk.smiles.SmilesParser;

/**
* @cdk.module test-inchi
Expand Down Expand Up @@ -143,4 +146,20 @@ public void testGetInChIToStructure_String_IChemObjectBuilder_NullList() throws
);
Assert.assertNotNull(parser);
}


@Test public void testSMILESConversion_TopologicalCentre() throws CDKException {

// (2R,3R,4S,5R,6S)-3,5-dimethylheptane-2,4,6-triol
SmilesParser parser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer container = parser.parseSmiles("C[C@@H](O)[C@@H](C)[C@@H](O)[C@H](C)[C@H](C)O");

InChIGenerator generator = InChIGeneratorFactory.getInstance().getInChIGenerator(container);

String expected = "InChI=1S/C9H20O3/c1-5(7(3)10)9(12)6(2)8(4)11/h5-12H,1-4H3/t5-,6-,7-,8+,9-/m1/s1";
String actual = generator.getInchi();

Assert.assertEquals("Incorrect InCHI generated for topological centre", expected, actual);

}
}

0 comments on commit bd922f6

Please sign in to comment.