Permalink
Browse files

updated test for single atom

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 ed04f25218f999151eb6160f9ffef97fc474e76d
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/test/org/openscience/cdk/smsd/SMSDTest.java
@@ -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.