@@ -77,6 +77,11 @@ test_that("mesim returns correct structure", {
7777 expect_true(" summary" %in% names(result ))
7878
7979 # Check dimensions
80+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
81+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
82+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
83+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
84+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
8085 expect_equal(length(result $ b_y ), data $ n_traits )
8186 expect_equal(length(result $ b_s ), data $ n_traits )
8287 expect_equal(length(result $ b_combined ), 2 * data $ n_traits )
@@ -612,7 +617,7 @@ test_that("mesim generates Trait_ names when pmat has no colnames (line 283)", {
612617
613618 result <- mesim(pmat_no_names , gmat_no_names , S_M_no_names )
614619
615- expect_true(all(grepl(" ^Trait_" , result $ trait_names )))
620+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
616621})
617622
618623# ==============================================================================
@@ -653,7 +658,7 @@ test_that("gesim errors when fewer than 2 traits are provided (line 476)", {
653658test_that(" gesim generates Trait_ names when pmat has no colnames (line 480)" , {
654659 data <- setup_eigen_test_data()
655660 result <- gesim(unname(data $ pmat ), unname(data $ gmat ), unname(data $ Gamma ))
656- expect_true(all(grepl(" ^Trait_" , result $ trait_names )))
661+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
657662})
658663
659664# Lines 533-534: implied_w tryCatch warning + NA in gesim
@@ -799,7 +804,7 @@ test_that("gw_esim generates Trait_ names when pmat has no colnames (line 684)",
799804 )
800805 M <- diag(n_markers )
801806 result <- gw_esim(unname(data $ pmat ), unname(data $ gmat ), G_M , M )
802- expect_true(all(grepl(" ^Trait_" , result $ trait_names )))
807+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
803808})
804809
805810# ==============================================================================
@@ -877,7 +882,7 @@ test_that("rgesim generates Trait_ names when pmat has no colnames (line 874)",
877882 data <- setup_eigen_test_data()
878883 U_mat <- matrix (c(1 , rep(0 , data $ n_traits - 1 )), nrow = 1 )
879884 result <- rgesim(unname(data $ pmat ), unname(data $ gmat ), unname(data $ Gamma ), U_mat )
880- expect_true(all(grepl(" ^Trait_" , result $ trait_names )))
885+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
881886})
882887
883888# Lines 958-959: implied_w tryCatch warning + NA in rgesim
@@ -971,7 +976,7 @@ test_that("ppg_gesim generates Trait_ names when pmat has no colnames (line 1120
971976 data <- setup_eigen_test_data()
972977 d <- rep(1 , data $ n_traits )
973978 result <- ppg_gesim(unname(data $ pmat ), unname(data $ gmat ), unname(data $ Gamma ), d )
974- expect_true(all(grepl(" ^Trait_" , result $ trait_names )))
979+ expect_true(all(grepl(" ^Trait_" , result $ trait_names , perl = TRUE )))
975980})
976981
977982# Lines 1221-1222: implied_w tryCatch warning + NA in ppg_gesim
0 commit comments