From be46537eeb6796b7fb827c8acbe58b1d4f83b5f5 Mon Sep 17 00:00:00 2001 From: "Martin R. Smith" <1695515+ms609@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:56:12 +0100 Subject: [PATCH] test l2cons --- tests/testthat/test-information.R | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/testthat/test-information.R b/tests/testthat/test-information.R index b0d3513f0..f4421b363 100644 --- a/tests/testthat/test-information.R +++ b/tests/testthat/test-information.R @@ -44,15 +44,20 @@ test_that("TreesConsistentWithTwoSplits works", { Test <- function(n, a, b, score) { logScore <- log(score) + l2Score <- log2(score) - expect_equal(score, TreesConsistentWithTwoSplits(n, a, b)) - expect_equal(score, TreesConsistentWithTwoSplits(n, b, a)) - expect_equal(score, TreesConsistentWithTwoSplits(n, n - a, n - b)) - expect_equal(score, TreesConsistentWithTwoSplits(n, n - b, n - a)) - expect_equal(logScore, LnTreesConsistentWithTwoSplits(n, a, b)) - expect_equal(logScore, LnTreesConsistentWithTwoSplits(n, b, a)) - expect_equal(logScore, LnTreesConsistentWithTwoSplits(n, n - a, n - b)) - expect_equal(logScore, LnTreesConsistentWithTwoSplits(n, n - b, n - a)) + expect_equal(TreesConsistentWithTwoSplits(n, a, b), score) + expect_equal(TreesConsistentWithTwoSplits(n, b, a), score) + expect_equal(TreesConsistentWithTwoSplits(n, n - a, n - b), score) + expect_equal(TreesConsistentWithTwoSplits(n, n - b, n - a), score) + expect_equal(Log2TreesConsistentWithTwoSplits(n, a, b), l2Score) + expect_equal(Log2TreesConsistentWithTwoSplits(n, b, a), l2Score) + expect_equal(Log2TreesConsistentWithTwoSplits(n, n - a, n - b), l2Score) + expect_equal(Log2TreesConsistentWithTwoSplits(n, n - b, n - a), l2Score) + expect_equal(LnTreesConsistentWithTwoSplits(n, a, b), logScore) + expect_equal(LnTreesConsistentWithTwoSplits(n, b, a), logScore) + expect_equal(LnTreesConsistentWithTwoSplits(n, n - a, n - b), logScore) + expect_equal(LnTreesConsistentWithTwoSplits(n, n - b, n - a), logScore) } Test(8, 3, 0, 315)