From ad29d7e18e6a89beaa6849dafb820ea6ac0030fb Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Sat, 28 Feb 2026 03:41:50 +0530 Subject: [PATCH 1/2] Fix missing space in loo_compare order stat warning message --- R/loo_compare.R | 2 +- tests/testthat/test_compare.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/loo_compare.R b/R/loo_compare.R index fdf0e368..326fb9e7 100644 --- a/R/loo_compare.R +++ b/R/loo_compare.R @@ -327,7 +327,7 @@ loo_order_stat_check <- function(loos, ord) { if (max(elpd_diff) <= order_stat) { # flag warning if we suspect no model is theoretically better than the baseline - warning("Difference in performance potentially due to chance.", + warning("Difference in performance potentially due to chance. ", "See McLatchie and Vehtari (2023) for details.", call. = FALSE) } diff --git a/tests/testthat/test_compare.R b/tests/testthat/test_compare.R index 7f720b22..4d49f025 100644 --- a/tests/testthat/test_compare.R +++ b/tests/testthat/test_compare.R @@ -62,7 +62,7 @@ test_that("loo_compare throws appropriate warnings", { }) expect_warning( loo_compare(w_list), - "Difference in performance potentially due to chance" + "Difference in performance potentially due to chance. See McLatchie and Vehtari (2023) for details." ) w_list_short <- lapply(1:4, function(x) { From 7f66ea0c05d25d1eaea4e0c8124e7c59b6e79474 Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Sat, 28 Feb 2026 03:53:49 +0530 Subject: [PATCH 2/2] Use fixed = TRUE in test to avoid regex issues with parentheses --- tests/testthat/test_compare.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test_compare.R b/tests/testthat/test_compare.R index 4d49f025..d21e0731 100644 --- a/tests/testthat/test_compare.R +++ b/tests/testthat/test_compare.R @@ -62,7 +62,8 @@ test_that("loo_compare throws appropriate warnings", { }) expect_warning( loo_compare(w_list), - "Difference in performance potentially due to chance. See McLatchie and Vehtari (2023) for details." + "Difference in performance potentially due to chance. See McLatchie and Vehtari (2023) for details.", + fixed = TRUE ) w_list_short <- lapply(1:4, function(x) {