Skip to content

Commit

Permalink
Test that if the atom type is not explicitly aromatic, it does not ov…
Browse files Browse the repository at this point in the history
…erwrite aromaticity information of the configured atom (see bug #1322)
  • Loading branch information
egonw committed Aug 10, 2016
1 parent 35f580d commit d4b2490
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,32 @@ public void unknownAtomTypeDoesNotModifyProperties() {
assertThat(atom.getSymbol(), is("C"));
assertThat(atom.getAtomicNumber(), is(6));
}

/**
* @cdk.bug 1322
*/
@Test
public void aromaticityIsNotOverwritten() {
IAtom atom = new Atom(Elements.CARBON);
atom.setFlag(CDKConstants.ISAROMATIC, true);
IAtomType atomType = new AtomType(Elements.Unknown.toIElement());
atomType.setFlag(CDKConstants.ISAROMATIC, false);
atomType.setAtomTypeName("C.sp3");
AtomTypeManipulator.configure(atom, atomType);
assertThat(atom.getFlag(CDKConstants.ISAROMATIC), is(true));
}

/**
* @cdk.bug 1322
*/
@Test
public void aromaticitySetIfForType() {
IAtom atom = new Atom(Elements.CARBON);
atom.setFlag(CDKConstants.ISAROMATIC, false);
IAtomType atomType = new AtomType(Elements.Unknown.toIElement());
atomType.setFlag(CDKConstants.ISAROMATIC, true);
atomType.setAtomTypeName("C.am");
AtomTypeManipulator.configure(atom, atomType);
assertThat(atom.getFlag(CDKConstants.ISAROMATIC), is(true));
}
}

0 comments on commit d4b2490

Please sign in to comment.