Skip to content

Commit

Permalink
Merge pull request #2125 from eseiler/misc/coverage
Browse files Browse the repository at this point in the history
[MISC] Increase search coverage to 100%
  • Loading branch information
rrahn committed Sep 22, 2020
2 parents b26aef7 + 8b6c1b7 commit 205674c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/search/search_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ TYPED_TEST(search_test, error_levenshtein)
EXPECT_RANGE_EQ(search("CCGT"_dna4, this->index, cfg) | position,
(std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}));
}
{
seqan3::configuration const cfg = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_count{4}};
EXPECT_RANGE_EQ(search("CCGT"_dna4, this->index, cfg) | position,
(std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}));
}
}

TYPED_TEST(search_test, error_indel_no_substitution)
Expand Down Expand Up @@ -408,6 +413,16 @@ TYPED_TEST(search_test, search_strategy_best)
ASSERT_EQ(result.size(), 1u);
EXPECT_TRUE(std::find(possible_hits2d.begin(), possible_hits2d.end(), result[0]) != possible_hits2d.end());
}

{ // Find best match with at most 2 of every error type.
seqan3::configuration const cfg = seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_count{2}} |
seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_count{2}} |
seqan3::search_cfg::max_error_substitution{
seqan3::search_cfg::error_count{2}} |
seqan3::search_cfg::hit_single_best;

EXPECT_RANGE_EQ(search("TATTA"_dna4, this->index, cfg) | position, (std::vector{3}));
}
}

TYPED_TEST(search_test, search_strategy_all_best)
Expand Down

0 comments on commit 205674c

Please sign in to comment.