Skip to content

Commit fcb2f6c

Browse files
committed
Failure test of mass difference.
1 parent b1f7284 commit fcb2f6c

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

storage/ctab/src/test/java/org/openscience/cdk/io/MDLReaderTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ public void testReadFromStringReader() throws Exception {
108108
Assert.assertEquals(9, m.getAtomCount());
109109
Assert.assertEquals(9, m.getBondCount());
110110
}
111+
112+
@Test
113+
public void testMassDiff() throws Exception {
114+
String mdl = "deuterium.mol\n" + "\n" + "\n" + " 1 0 0 0 0 1\n"
115+
+ " 0.0000 0.0000 0.0000 H +1 0 0 0 0\n";
116+
try (MDLReader reader = new MDLReader(new StringReader(mdl), Mode.STRICT)) {
117+
IAtomContainer mol = reader.read(new AtomContainer());
118+
IAtom atom = mol.getAtom(0);
119+
Assert.assertEquals(1, atom.getAtomicNumber().intValue());
120+
Assert.assertEquals(2, atom.getMassNumber().intValue());
121+
}
122+
}
111123

112124
/**
113125
* @cdk.bug 1542467

storage/ctab/src/test/java/org/openscience/cdk/io/MDLV2000ReaderTest.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,20 @@ public void seaborgiumAbsMass() throws Exception {
17271727
}
17281728
}
17291729

1730-
1731-
1730+
@Test
1731+
public void testMassDiff() throws Exception {
1732+
String mdl = "deuterium.mol\n" + "\n" + "\n" + " 1 0 0 0 0 1 V2000\n"
1733+
+ " 0.0000 0.0000 0.0000 H +1 0 0 0 0\n"
1734+
+ "M END\n";
1735+
try (StringReader in = new StringReader(mdl)) {
1736+
MDLV2000Reader reader = new MDLV2000Reader(new StringReader(mdl), Mode.STRICT);
1737+
IAtomContainer mol = reader.read(new AtomContainer());
1738+
IAtom atom = mol.getAtom(0);
1739+
Assert.assertEquals(1, atom.getAtomicNumber().intValue());
1740+
Assert.assertEquals(2, atom.getMassNumber().intValue());
1741+
}
1742+
}
1743+
17321744
@Test
17331745
public void testBadAtomCoordinateFormat() throws Exception {
17341746

0 commit comments

Comments
 (0)