|
24 | 24 | * */ |
25 | 25 | package org.openscience.cdk.io; |
26 | 26 |
|
| 27 | +import org.hamcrest.CoreMatchers; |
27 | 28 | import org.junit.Assert; |
28 | 29 | import org.junit.BeforeClass; |
29 | 30 | import org.junit.Test; |
|
40 | 41 | import org.openscience.cdk.interfaces.IBond; |
41 | 42 | import org.openscience.cdk.interfaces.IBond.Order; |
42 | 43 | import org.openscience.cdk.interfaces.IChemFile; |
| 44 | +import org.openscience.cdk.interfaces.IChemObject; |
| 45 | +import org.openscience.cdk.interfaces.IChemObjectBuilder; |
43 | 46 | import org.openscience.cdk.interfaces.IPseudoAtom; |
44 | 47 | import org.openscience.cdk.interfaces.IStereoElement; |
45 | 48 | import org.openscience.cdk.interfaces.ITetrahedralChirality; |
|
51 | 54 | import org.openscience.cdk.sgroup.SgroupBracket; |
52 | 55 | import org.openscience.cdk.sgroup.SgroupKey; |
53 | 56 | import org.openscience.cdk.sgroup.SgroupType; |
| 57 | +import org.openscience.cdk.silent.SilentChemObjectBuilder; |
54 | 58 | import org.openscience.cdk.tools.ILoggingTool; |
55 | 59 | import org.openscience.cdk.tools.LoggingToolFactory; |
56 | 60 | import org.openscience.cdk.tools.manipulator.AtomContainerManipulator; |
@@ -1790,4 +1794,23 @@ public void testBadAtomCoordinateFormat() throws Exception { |
1790 | 1794 | final org.openscience.cdk.silent.AtomContainer atomContainer = mdlv2000Reader.read(new org.openscience.cdk.silent.AtomContainer()); |
1791 | 1795 | Assert.assertEquals(17, atomContainer.getAtomCount()); |
1792 | 1796 | } |
| 1797 | + |
| 1798 | + @Test public void test() throws Exception { |
| 1799 | + String input = "\n" + |
| 1800 | + "Structure query\n" + |
| 1801 | + "\n" + |
| 1802 | + " 1 0 0 0 0 0 0 0 0 0999 V2000\n" + |
| 1803 | + " 2430.7100 2427.0000 0.0000 C 0 0 0 0 0 0\n" + |
| 1804 | + "A 1\n" + |
| 1805 | + "Blah\n" + |
| 1806 | + "M END"; |
| 1807 | + IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance(); |
| 1808 | + try (MDLV2000Reader mdlr = new MDLV2000Reader(new StringReader(input))) { |
| 1809 | + IAtomContainer mol = mdlr.read(bldr.newAtomContainer()); |
| 1810 | + assertThat(mol.getAtom(0), |
| 1811 | + instanceOf(IPseudoAtom.class)); |
| 1812 | + assertThat(((IPseudoAtom)mol.getAtom(0)).getLabel(), |
| 1813 | + is("Blah")); |
| 1814 | + } |
| 1815 | + } |
1793 | 1816 | } |
0 commit comments