From 5171a4f1796251d2dd83d4b14902a9843c12f276 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Tue, 7 Feb 2023 10:37:29 +0100 Subject: [PATCH] Added unit tests (#3) --- tests/testthat/test-spatialMixture.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/testthat/test-spatialMixture.R b/tests/testthat/test-spatialMixture.R index 1f61c4c..82f2689 100644 --- a/tests/testthat/test-spatialMixture.R +++ b/tests/testthat/test-spatialMixture.R @@ -51,3 +51,11 @@ test_that("lakseKlitik() and subfunctions produce expected output", { # TODO: ... and anythin left from findCliques.m # TODO: test lakseKlitik() }) + +test_that("testFastaData() produces same output as on MATLAB", { + msa <- system.file("ext", "seqs.fa", package = "rBAPS") + test_msa <- testFastaData(msa) + expect_equal(test_msa$ninds, 515) + expect_equal(dim(test_msa$data), c(515, 745)) + expect_named(table(test_msa$data), c("-9", as.character(1:515))) +})