Skip to content

Commit

Permalink
[Update] Add test for invalid bim file
Browse files Browse the repository at this point in the history
  • Loading branch information
choishingwan committed Apr 14, 2020
1 parent 3d93276 commit a171bc7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/csrc/binaryplink_snp_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,19 @@ TEST_CASE("generate snp vector")
bplink.manual_load_snp(SNP("SNP_5", 1, 742429, "A", "C", 1, 1));
// load SNP

SECTION("invalid bp")
SECTION("invalid SNPs")
{
bim.open("load_snp2.bim");
bim << "chr2 SNP_5 0 -742429 1 2" << std::endl;
auto input = GENERATE("chr1 SNP_5 0 -742429 A C",
"chr1 SNP_5 0 742429 A",
"chr1 SNP_5 0 742429 A C G");
bim << input << std::endl;
bim.close();
bplink.gen_bed_head("load_snp2.bed", num_sample, 3, true, false);
REQUIRE_THROWS(bplink.load_snps(
"load_snp", std::vector<IITree<size_t, size_t>> {}, false));
}
SECTION("filtered out exxept mismatch")
SECTION("filtered out except mismatch")
{
auto input = GENERATE("chrX SNP_5 0 742429 A C",
"chr1 SNP_5 0 742429 A G");
Expand Down

0 comments on commit a171bc7

Please sign in to comment.