Skip to content

Commit 32684f6

Browse files
Squashed commit of the following:
commit 42ae819 Author: Mason Garrison <garrissm@wfu.edu> Date: Mon Apr 13 16:08:31 2026 -0400 Update test-makeLinks.R
1 parent 1c193a4 commit 32684f6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/testthat/test-makeLinks.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,15 @@ test_that("com2links handles mismatched matrix dimensions by subsetting to small
355355
# Only IDs from the smaller matrix should appear
356356
all_output_ids <- unique(c(result_mismatch$ID1, result_mismatch$ID2))
357357
expect_true(all(all_output_ids %in% as.numeric(dimnames(ad_small)[[1]])))
358+
expect_true(all(all_output_ids %in% as.numeric(dimnames(mit_ped_matrix)[[1]])))
359+
expect_true(all(all_output_ids %in% as.numeric(dimnames(cn_ped_matrix)[[1]])))
360+
361+
# Check that the number of unique IDs in the output matches the number of IDs in the smallest matrix
362+
expect_equal(length(all_output_ids), length(subset_ids))
363+
364+
# check that full matrix has more unique IDs than the smaller matrix
365+
expect_true(length(unique(c(dimnames(mit_ped_matrix)[[1]],
366+
dimnames(cn_ped_matrix)[[1]]))) > length(subset_ids))
358367
})
359368

360369
test_that("com2links mismatched dimensions with two matrices", {

0 commit comments

Comments
 (0)