Skip to content

Commit

Permalink
more mdl reader writer tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
Stefan Kuhn authored and rajarshi committed May 12, 2010
1 parent 3b974e6 commit 353f938
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/data/mdl/ChEBI_26120.mol
Expand Up @@ -53,7 +53,7 @@
8 10 1 0 0 0 0
9 11 1 0 0 0 0
9 12 1 0 0 0 0
10 13 2 3 0 0 0
10 13 2 4 0 0 0
10 14 1 0 0 0 0
11 15 1 0 0 0 0
13 16 1 0 0 0 0
Expand Down
26 changes: 26 additions & 0 deletions src/test/data/mdl/a-pinene-with-undefined-stereo.mol
@@ -0,0 +1,26 @@
a-pinen.mol
ChemDraw08319810042D

10 11 0 0 0 0 0 0 0 0 1 V2000
-2.0500 -1.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7500 -0.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.5500 -1.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7500 -1.8500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7500 -0.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.8100 -1.4100 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3625 1.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.0500 0.4000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.9375 1.8500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6625 1.8500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 3 0 0 0
1 3 1 4 0 0 0
3 4 1 0 0 0 0
2 5 1 0 0 0 0
5 6 2 0 0 0 0
4 6 1 0 0 0 0
2 7 1 0 0 0 0
3 7 1 0 0 0 0
5 8 1 0 0 0 0
7 9 1 0 0 0 0
7 10 1 0 0 0 0
M END
13 changes: 13 additions & 0 deletions src/test/org/openscience/cdk/io/MDLReaderTest.java
Expand Up @@ -193,4 +193,17 @@ public class MDLReaderTest extends SimpleChemObjectReaderTest {
Assert.assertNull(mol);
}


@Test public void testUndefinedStereo() throws Exception {
String filename = "data/mdl/ChEBI_26120.mol";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
MDLReader reader = new MDLReader(ins, Mode.RELAXED);
IMolecule mol = (IMolecule)reader.read(new NNMolecule());
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(1).getStereo());
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(6).getStereo());
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(7).getStereo());
Assert.assertEquals(IBond.Stereo.UP_OR_DOWN,mol.getBond(11).getStereo());
}

}
1 change: 1 addition & 0 deletions src/test/org/openscience/cdk/io/MDLV2000ReaderTest.java
Expand Up @@ -575,6 +575,7 @@ public class MDLV2000ReaderTest extends SimpleChemObjectReaderTest {
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(1).getStereo());
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(6).getStereo());
Assert.assertEquals(IBond.Stereo.E_OR_Z,mol.getBond(7).getStereo());
Assert.assertEquals(IBond.Stereo.UP_OR_DOWN,mol.getBond(11).getStereo());
}

/**
Expand Down

0 comments on commit 353f938

Please sign in to comment.