Fix issues #1, #3, #5: misc improvements
R-CMD-check / R CMD check (pull_request) Failing after 4m43s

- #5: Unwrap _brand.yml for Quarto 1.9+ compatibility (remove top-level
  brand: wrapper so meta/logo/color/typography are at the top level)
- #1: Add quiet parameter to na_sum() to suppress warnings in loops/pipelines
- #3: Add beep() function for CLI beep, desktop notifications, and webhook
  alerts (supports type=beep|notify|webhook|all)
This commit is contained in:
2026-06-03 19:01:30 +00:00
parent 136c53643c
commit 2f1cdcde52
6 changed files with 246 additions and 61 deletions
+22
View File
@@ -0,0 +1,22 @@
# Test beep / notification function
context("Test beep() function")
test_that("beep() returns invisibly", {
expect_invisible(beep())
expect_invisible(beep("test", type = "beep"))
expect_invisible(beep("test", type = "all"))
})
test_that("beep() with quiet=TRUE produces no output", {
expect_silent(beep("test", type = "beep", quiet = TRUE))
})
test_that("beep() with type=notify is silent when no tools available", {
# When notify-send and osascript are both absent, should be silent
expect_silent(beep("test", type = "notify"))
})
test_that("beep() with type=webhook and no URL is silent", {
expect_silent(beep("test", type = "webhook"))
})
+6
View File
@@ -58,6 +58,12 @@ test_that("na_sum fails with non-numerics", {
expect_error(na_sum(as.factor(1:10)))
})
test_that("na_sum quiet=TRUE suppresses the message", {
expect_message(na_sum(c(1:10, NA)), "Taking a sum")
expect_silent(na_sum(c(1:10, NA), quiet = TRUE))
expect_equal(na_sum(c(1:10, NA), quiet = TRUE), 55)
})
context("Test Utilities - Pretty Count")