Skip to content

Commit 14c1c74

Browse files
authored
Merge pull request #524 from utkarshpawade/test/theme-helper-coverage
Add tests for theme/aesthetic helper functions
2 parents 6d49142 + 6f82364 commit 14c1c74

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# bayesplot (development version)
22

3+
* Added test verifying `legend_move("none")` behaves equivalently to `legend_none()`.
34
* Added singleton-dimension edge-case tests for exported `_data()` functions.
45
* Validate empty list and zero-row matrix inputs in `nuts_params.list()`.
56
* Validate user-provided `pit` values in `ppc_loo_pit_data()` and `ppc_loo_pit_qq()`, rejecting non-numeric inputs, missing values, and values outside `[0, 1]`.

tests/testthat/test-convenience-functions.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ test_that("legend_text returns correct theme object", {
120120
theme(legend.text = element_text(color = "purple", size = 16))
121121
)
122122
})
123+
test_that("legend_move('none') behaves like legend_none", {
124+
expect_equal(
125+
legend_move("none")$legend.position,
126+
legend_none()$legend.position,
127+
ignore_attr = TRUE
128+
)
129+
})
123130

124131
# axis and facet text --------------------------------------------------
125132
test_that("xaxis_text returns correct theme object", {
@@ -186,8 +193,6 @@ test_that("overlay_function returns the correct object", {
186193
a$constructor <- b$constructor <- NULL
187194
expect_equal(a, b, ignore_function_env = TRUE)
188195
})
189-
190-
191196
# tagged functions -------------------------------------------------------
192197

193198
test_that("as_tagged_function handles bare function (symbol)", {

0 commit comments

Comments
 (0)