Skip to content

Commit

Permalink
updated test for single atom
Browse files Browse the repository at this point in the history
Signed-off-by: Syed Asad Rahman <s9asad@gmail.com>
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
asad authored and rajarshi committed May 20, 2010
1 parent 82f40a1 commit ed04f25
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/org/openscience/cdk/smsd/SMSDTest.java
Expand Up @@ -561,4 +561,22 @@ public void testQueryAtomContainerTurbo() throws CDKException {
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}

@Test
public void testQueryAtomSingle() throws CDKException {
SMSD smsd = new SMSD(Algorithm.DEFAULT, true);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer query = sp.parseSmiles("C");
IAtomContainer target = sp.parseSmiles("CC");

smsd.init(query, target, false);
boolean foundMatches = smsd.isSubgraph();
Assert.assertEquals(1, smsd.getFirstMapping().size());
Assert.assertTrue(foundMatches);

IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
}

0 comments on commit ed04f25

Please sign in to comment.