From 10b3774101226beb1f03dd1deb76b8f2c539b9a1 Mon Sep 17 00:00:00 2001 From: dv Date: Wed, 20 Jul 2011 17:22:44 +0200 Subject: Added test_match_hits to compound and modified test_p_sum_support /test_tanimoto in algorithm --- compound.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compound.rb') diff --git a/compound.rb b/compound.rb index 048e012..5165f31 100644 --- a/compound.rb +++ b/compound.rb @@ -39,4 +39,8 @@ class CompoundTest < Test::Unit::TestCase assert_equal "CCC=C(CC)N(=O)=O", c.to_smiles end + def test_match_hits + c = OpenTox::Compound.from_smiles "N=C=C1CCC(=F=FO)C1" + assert_equal ({"FF"=>2, "CC"=>10, "C"=>6, "C1CCCC1"=>10, "C=C"=>2}), c.match_hits(['CC','F=F','C','C=C','FF','C1CCCC1','OO']) + end end -- cgit v1.2.3