From 65c07ff4761b61cde8ce8b30c40fc89c428e7534 Mon Sep 17 00:00:00 2001 From: "Martin R. Smith" <1695515+ms609@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:05:38 +0100 Subject: [PATCH] tidy --- tests/testthat/test-different-tips.R | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-different-tips.R b/tests/testthat/test-different-tips.R index 06b499cb..9cba48d4 100644 --- a/tests/testthat/test-different-tips.R +++ b/tests/testthat/test-different-tips.R @@ -1,12 +1,14 @@ library("TreeTools", quietly = TRUE) -bal8 <- BalancedTree(8) -pec8 <- PectinateTree(8) -bal8BG <- DropTip(bal8, c(1, 8)) -pec8BG <- DropTip(pec8, c(1, 8)) -bal8CH <- DropTip(bal8, 1:2) -pec8CH <- DropTip(pec8, 1:2) +{ # Reference objects + bal8 <- BalancedTree(8) + pec8 <- PectinateTree(8) + bal8BG <- DropTip(bal8, c(1, 8)) + pec8BG <- DropTip(pec8, c(1, 8)) + bal8CH <- DropTip(bal8, 1:2) + pec8CH <- DropTip(pec8, 1:2) +} -test_that("Non-identical tips handled okay", { +test_that("Non-identical tips are handled okay", { fullDist <- TreeDistance(bal8, pec8) expect_equal(TreeDistance(bal8, bal8BG), 0) expect_equal(MutualClusteringInfo(bal8, bal8BG), ClusteringEntropy(bal8BG))