From 17fae8b275e549a6939da3c643411038402ea733 Mon Sep 17 00:00:00 2001 From: John May Date: Mon, 28 Nov 2016 20:12:21 +0000 Subject: [PATCH] New invariants in SmilesGenerator guard against unsafe aromaticity - update tests. --- .../test/java/org/openscience/cdk/smiles/CDKToBeamTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/smiles/src/test/java/org/openscience/cdk/smiles/CDKToBeamTest.java b/storage/smiles/src/test/java/org/openscience/cdk/smiles/CDKToBeamTest.java index 1744526375..8a8ba5abac 100644 --- a/storage/smiles/src/test/java/org/openscience/cdk/smiles/CDKToBeamTest.java +++ b/storage/smiles/src/test/java/org/openscience/cdk/smiles/CDKToBeamTest.java @@ -231,6 +231,8 @@ public void aromaticBond() throws Exception { Map mock = mock(Map.class); when(mock.get(u)).thenReturn(0); when(mock.get(v)).thenReturn(1); + when(u.isAromatic()).thenReturn(true); + when(v.isAromatic()).thenReturn(true); CDKToBeam c2g = new CDKToBeam(); assertThat(c2g.toBeamEdge(b, mock), is(uk.ac.ebi.beam.Bond.AROMATIC.edge(0, 1))); } @@ -492,13 +494,15 @@ public void z_1_2_difluoroethene_aromatic() throws Exception { ac.addBond(0, 1, SINGLE); ac.addBond(1, 2, DOUBLE); ac.addBond(2, 3, SINGLE); + ac.getAtom(1).setIsAromatic(true); + ac.getAtom(2).setIsAromatic(true); ac.getBond(1).setFlag(CDKConstants.ISAROMATIC, true); ac.addStereoElement(new DoubleBondStereochemistry(ac.getBond(1), new IBond[]{ac.getBond(0), ac.getBond(2)}, TOGETHER)); Graph g = convert(ac, SmiFlavor.UseAromaticSymbols); - assertThat(g.toSmiles(), is("F[CH]:[CH]F")); + assertThat(g.toSmiles(), is("FccF")); } @Test