From ee956f703512a9caa66c4a8b64e515c78cfcbe7c Mon Sep 17 00:00:00 2001 From: Sarbjit Singh Date: Mon, 5 Mar 2018 22:55:18 +0530 Subject: [PATCH] Added test cases for svlen --- test/vcf/optional_policy_test.cpp | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/test/vcf/optional_policy_test.cpp b/test/vcf/optional_policy_test.cpp index eda1b0e89..4a383a23e 100644 --- a/test/vcf/optional_policy_test.cpp +++ b/test/vcf/optional_policy_test.cpp @@ -135,6 +135,51 @@ namespace ebi vcf::InfoBodyError*); } } + + SECTION("SVLEN test") + { + source->meta_entries.emplace(vcf::INFO, + vcf::MetaEntry{ + 1, + vcf::INFO, + { + { vcf::ID, vcf::SVLEN }, + { vcf::NUMBER, "2" }, + { vcf::TYPE, vcf::INTEGER }, + { vcf::DESCRIPTION, "Difference in length between REF and ALT alleles" } + }, + source + }); + + CHECK_NOTHROW( (optional_policy.optional_check_body_entry(parsing_state, vcf::Record{ + 1, + "chr1", + 123456, + { "id123" }, + "A", + { "AC","AT" }, + 1.0, + { vcf::PASS }, + { { vcf::SVLEN, "1,2" } }, + { vcf::GT }, + { "1|0" }, + source})) ); + + CHECK_THROWS_AS( (optional_policy.optional_check_body_entry(parsing_state, vcf::Record{ + 1, + "chr1", + 123456, + { "id123" }, + "A", + { "AC" }, + 1.0, + { vcf::PASS }, + { { vcf::SVLEN, "1,2" } }, + { vcf::GT }, + { "0|1" }, + source})), + vcf::InfoBodyError*); + } } TEST_CASE("Alternate allele warnings", "[body alt warnings]")