File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
360369test_that(" com2links mismatched dimensions with two matrices" , {
You can’t perform that action at this time.
0 commit comments