Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit ed04f25218f999151eb6160f9ffef97fc474e76d 1 parent 82f40a1
@asad asad authored rajarshi committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/test/org/openscience/cdk/smsd/SMSDTest.java
View
18 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);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.