From 721325ce098cfdfb79126545461e3e7122532cc7 Mon Sep 17 00:00:00 2001 From: LynxJinyangii Date: Mon, 9 Feb 2026 17:52:50 +0000 Subject: [PATCH] Added unit tests for crossing --- tests/testthat/test-crossing.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testthat/test-crossing.R b/tests/testthat/test-crossing.R index 290cf220..9fd40432 100644 --- a/tests/testthat/test-crossing.R +++ b/tests/testthat/test-crossing.R @@ -11,6 +11,10 @@ test_that("makeCross",{ SP$setTrackPed(TRUE) pop = newPop(founderPop,simParam=SP) crossPlan = cbind(rep(1,10),rep(2,10)) + expect_error(makeCross(pop=pop,crossPlan=matrix(c("3", "4"), ncol = 2),simParam=SP), + regexp = "Failed to match supplied IDs") + expect_error(makeCross(pop=pop,crossPlan=matrix(c(3, 4), ncol = 2),simParam=SP), + regexp = "Invalid crossPlan") #Match by number pop1 = makeCross(pop=pop,crossPlan=crossPlan,simParam=SP) expect_equal(SP$lastId,12L)