Skip to content

Commit

Permalink
Merge pull request #179 from cdk/patch/smiles-fixup
Browse files Browse the repository at this point in the history
Looks good.
  • Loading branch information
egonw committed Nov 27, 2015
2 parents f199800 + 21d138e commit 460b001
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@
<dependency>
<groupId>uk.ac.ebi.beam</groupId>
<artifactId>beam-core</artifactId>
<version>0.9</version>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.beam</groupId>
<artifactId>beam-func</artifactId>
<version>0.9</version>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ public IAtomContainer parseSmiles(String smiles) throws InvalidSmilesException {
return beamToCDK.toAtomContainer(kekulise ? g.kekule() : g);
} catch (IOException e) {
throw new InvalidSmilesException("could not parse '" + smiles + "', " + e.getMessage());
} catch (Exception e) {
throw new InvalidSmilesException("could not parse '" + smiles + "'");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ public void assignDbStereo() throws Exception {
String in = "C(/N)=C\\C=C\\1/N=C1";
SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer mol = smipar.parseSmiles(in);
Assert.assertEquals("C(/N)=C\\C=C\\1/N=C1", SmilesGenerator.isomeric().create(mol));
Assert.assertEquals("C(\\N)=C/C=C/1\\N=C1", SmilesGenerator.isomeric().create(mol));
}

static ITetrahedralChirality anticlockwise(IAtomContainer container, int central, int a1, int a2, int a3, int a4) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,15 @@ public void testDiBorane() throws Exception {
Assert.assertEquals(2, mol.getConnectedAtomsCount(mol.getAtom(5)));
}

/**
* Okay exception for a non-SMILES string.
* @cdk.bug 1375
*/
@Test(expected = InvalidSmilesException.class)
public void idNumber() throws Exception {
load("50-00-0");
}

/**
* Counts aromatic atoms in a molecule.
* @param mol molecule for which to count aromatic atoms.
Expand Down

0 comments on commit 460b001

Please sign in to comment.