From b57bc3f299f8d413bedccad6e6c505cc082fcdb7 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Fri, 27 Sep 2024 13:22:40 +0200 Subject: [PATCH] Added logml tests for #24 --- tests/testthat/test-greedyMix.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testthat/test-greedyMix.R b/tests/testthat/test-greedyMix.R index 02b1007..402af13 100644 --- a/tests/testthat/test-greedyMix.R +++ b/tests/testthat/test-greedyMix.R @@ -65,15 +65,18 @@ test_that("greedyMix() fails successfully", { }) test_that("greedyMix() works when it should", { + tol <- 1e-4 baps_file <- file.path(path_inst, "BAPS_clustering_diploid.txt") greedy_baps <- greedyMix(baps_file, "BAPS") expect_type(greedy_baps, "list") expect_length(greedy_baps, 10L) + expect_equal(greedy_baps[['logml']], -78.10151, tolerance = tol) genepop_file <- file.path(path_inst, "GenePop.txt") greedy_genepop <- greedyMix(genepop_file, "GenePop") expect_type(greedy_genepop, "list") expect_length(greedy_genepop, 10L) + expect_equal(greedy_genepop[['logml']], -10.76224, tolerance = tol) fasta_file <- file.path(path_inst, "FASTA_clustering_haploid.fasta") })