Skip to content

Commit 43c10ee

Browse files
committed
add basic test
1 parent 28ca4f9 commit 43c10ee

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/testthat/_snaps/edition.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# basic edition infrastructure works as intended
2+
3+
Code
4+
edition_deprecate(2025, what = "foo()")
5+
Condition
6+
Error:
7+
! `foo()` was deprecated in ggplot2 edition 2025 and is now defunct.
8+
9+
---
10+
11+
Code
12+
edition_require(2025, what = "foo()")
13+
Condition
14+
Error in `edition_require()`:
15+
! foo() requires the 2025 edition of ggplot2.
16+

tests/testthat/test-edition.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
test_that("basic edition requirement and deprecation works as intended", {
2+
3+
local_edition(2025)
4+
expect_snapshot(edition_deprecate(2025, what = "foo()"), error = TRUE)
5+
expect_silent(edition_require(2025, what = "foo()"))
6+
7+
local_edition(2024)
8+
expect_silent(edition_deprecate(2025, what = "foo()"))
9+
expect_snapshot(edition_require(2025, what = "foo()"), error = TRUE)
10+
})

0 commit comments

Comments
 (0)