Skip to content

Commit

Permalink
Unit tests for SMILES parsing bugs reported in #3048501
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw committed Sep 7, 2010
1 parent 3f6056b commit bb5ffe1
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions src/test/org/openscience/cdk/smiles/SmilesParserTest.java
Expand Up @@ -1849,6 +1849,77 @@ public void testPyrolle() throws InvalidSmilesException{
}
}

/**
* @cdk.bug 3048501
*/
@Test
public void testAromaticSeParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("c1cc2cccnc2[se]1");
for (IAtom atom : mol.atoms()) {
Assert.assertTrue(atom.getFlag(CDKConstants.ISAROMATIC));
}
}

/**
* @cdk.bug 3048501
*/
@Test
public void testCeParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("Cl[Ce](Cl)Cl");
Assert.assertEquals("Ce", mol.getAtom(1).getSymbol());
}

/**
* @cdk.bug 3048501
*/
@Test
public void testErParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("Cl[Er](Cl)Cl");
Assert.assertEquals("Er", mol.getAtom(1).getSymbol());
}

/**
* @cdk.bug 3048501
*/
@Test
public void testGdParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("Cl[Gd](Cl)Cl");
Assert.assertEquals("Gd", mol.getAtom(1).getSymbol());
}

/**
* @cdk.bug 3048501
*/
@Test
public void testSmParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("Cl[Sm](Cl)Cl");
Assert.assertEquals("Sm", mol.getAtom(1).getSymbol());
}

/**
* @cdk.bug 3048501
*/
@Test
public void testLaParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("[Cl-].[Cl-].[Cl-].[La+3]");
Assert.assertEquals("La", mol.getAtom(3).getSymbol());
}

/**
* @cdk.bug 3048501
*/
@Test
public void testAcParsing() throws InvalidSmilesException{
SmilesParser p = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IMolecule mol = p.parseSmiles("[255Ac]");
Assert.assertEquals("Ac", mol.getAtom(0).getSymbol());
}
/**
* @cdk.bug 2976054
* @throws InvalidSmilesException
Expand Down

0 comments on commit bb5ffe1

Please sign in to comment.