Permalink
Browse files

Added another test to check that a query larger than the target does …

…not match
  • Loading branch information...
1 parent 15fa35a commit 088afcedde529bdbc30db07edefe0c25651aced7 @rajarshi rajarshi committed May 20, 2010
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/test/org/openscience/cdk/smsd/SMSDTest.java
View
14 src/test/org/openscience/cdk/smsd/SMSDTest.java
@@ -530,7 +530,7 @@ public void testQueryAtomContainerSubstructure() throws CDKException {
}
@Test
- public void testQueryAtomSingle() throws CDKException {
+ public void testMatchCount() throws CDKException {
SMSD smsd = new SMSD(Algorithm.DEFAULT, true);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer query = sp.parseSmiles("CC");
@@ -546,4 +546,16 @@ public void testQueryAtomSingle() throws CDKException {
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
+
+ @Test
+ public void testImpossibleQuery() throws CDKException {
+ SMSD smsd = new SMSD(Algorithm.DEFAULT, true);
+ SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
+ IAtomContainer query = sp.parseSmiles("CC");
+ IAtomContainer target = sp.parseSmiles("C");
+
+ smsd.init(query, target, false);
+ boolean foundMatches = smsd.isSubgraph();
+ Assert.assertFalse(foundMatches);
+ }
}

0 comments on commit 088afce

Please sign in to comment.