Skip to content

Commit

Permalink
Adjusted unit tests for #25
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Sep 11, 2023
1 parent 2b75657 commit ce954bf
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tests/testthat/test-greedyMix.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,41 @@ test_that("handleData works as expected", {

context("Processing files through greedyMix")

df_fasta <- greedyMix(
raw_fasta <- importFile(
data = file.path(path_inst, "FASTA_clustering_haploid.fasta"),
format = "FASTA"
)
df_vcf <- greedyMix(
raw_vcf <- importFile(
data = file.path(path_inst, "vcf_example.vcf"),
format = "VCF",
verbose = FALSE
)
df_bam <- greedyMix(
df_bam <- importFile(
data = file.path(path_inst, "bam_example.bam"),
format = "BAM",
)

test_that("Files are imported correctly", {
expect_equal(dim(df_fasta), c(5, 99))
expect_equal(dim(df_vcf), c(variants = 2, fix_cols = 8, gt_cols = 3))
expect_equal(dim(raw_fasta), c(5, 99))
expect_equal(dim(raw_vcf), c(variants = 2, fix_cols = 8, gt_cols = 3))
expect_error(
greedyMix(
importFile(
data = paste(path_inst, "sam_example.sam", sep = "/"),
format = "SAM",
)
)
expect_equal(length(df_bam[[1]]), 13)
})

df_fasta <- greedyMix(
data = file.path(path_inst, "FASTA_clustering_haploid.fasta"),
format = "FASTA"
)
test_that("greedyMix() works", {
expect_error(greedyMix(file.path(path_inst, "vcf_example.vcf")))
expect_error(greedyMix(file.path(path_inst, "bam_example.bam")))
})

context("Linkage")

test_that("Linkages are properly calculated", {
Expand Down

0 comments on commit ce954bf

Please sign in to comment.