Skip to content

Commit

Permalink
additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dramanica committed Oct 19, 2024
1 parent bfac505 commit 64cf3af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
branches: [main, vcf_windows]
pull_request:
branches: [main]

Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test_gen_tibble.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,26 @@ test_that("gen_tibble from files with missingness",{

# check our cpp parser
pop_b_vcf_fast_gt <- gen_tibble(vcf_path, quiet=TRUE,backingfile = tempfile(), parser="cpp")

# debug
if (!all.equal(show_genotypes(pop_b_gt),show_genotypes(pop_b_vcf_fast_gt))) {
print(show_genotypes(pop_b_gt))
print(show_genotypes(pop_b_vcf_fast_gt))
}

expect_true(all.equal(show_genotypes(pop_b_gt),show_genotypes(pop_b_vcf_fast_gt)))
# check loci table against the vcfR parser
expect_true(all.equal(show_loci(pop_b_vcf_gt), show_loci(pop_b_vcf_fast_gt)))
# reload it in chunks
pop_b_vcf_fast_gt2 <- gen_tibble(vcf_path, quiet=TRUE, backingfile = tempfile(),
chunk_size = 2, parser="cpp")

# debug
if (!all.equal(show_genotypes(pop_b_vcf_fast_gt2),show_genotypes(pop_b_vcf_fast_gt))) {
print(show_genotypes(pop_b_vcf_fast_gt2))
print(show_genotypes(pop_b_vcf_fast_gt))
}

expect_true(all.equal(show_genotypes(pop_b_vcf_fast_gt2),show_genotypes(pop_b_vcf_fast_gt)))
expect_true(all.equal(show_loci(pop_b_vcf_gt), show_loci(pop_b_vcf_fast_gt)))
expect_true(is.integer(show_loci(pop_b_vcf_fast_gt)$chr_int))
Expand Down

0 comments on commit 64cf3af

Please sign in to comment.