Skip to content

Commit 13dd2f5

Browse files
committed
update snapshots
1 parent 6849bc9 commit 13dd2f5

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

tests/testthat/_snaps/coord-.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
check_coord_limits(xlim(1, 2))
2525
Condition
2626
Error:
27-
! `xlim(1, 2)` must be a vector of length 2, not a <ScaleContinuousPosition> object.
27+
! `xlim(1, 2)` must be a vector, not a <ScaleContinuousPosition> object.
2828

2929
---
3030

3131
Code
3232
check_coord_limits(1:3)
3333
Condition
3434
Error:
35-
! `1:3` must be a vector of length 2, not an integer vector of length 3.
35+
! `1:3` must be a vector of length 2, not length 3.
3636

tests/testthat/_snaps/labels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ggplotGrob(p + theme(plot.tag.position = c(0, 0.5, 1)))
3232
Condition
3333
Error in `theme()`:
34-
! A <numeric> `plot.tag.position` theme setting must have length 2.
34+
! A <numeric> `plot.tag.position` must be a vector of length 2, not length 3.
3535

3636
---
3737

tests/testthat/_snaps/scale-date.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
---
77

88
A <numeric> value was passed to a Datetime scale.
9-
i The value was converted to a <POSIXt/POSIXct> object.
9+
i The value was converted to a <POSIXt> object.
1010

tests/testthat/_snaps/scales.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,19 @@
9999

100100
The `scale_name` argument of `binned_scale()` is deprecated as of ggplot2 3.5.0.
101101

102+
# continuous scales warn about faulty `limits`
103+
104+
Code
105+
scale_x_continuous(limits = c("A", "B"))
106+
Condition
107+
Error in `scale_x_continuous()`:
108+
! `limits` must be a <numeric> vector, not a character vector.
109+
110+
---
111+
112+
Code
113+
scale_x_continuous(limits = 1:3)
114+
Condition
115+
Error in `scale_x_continuous()`:
116+
! `limits` must be a vector of length 2, not length 3.
117+

tests/testthat/test-scales.R

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,8 @@ test_that("Discrete scales with only NAs return `na.value`", {
730730
})
731731

732732
test_that("continuous scales warn about faulty `limits`", {
733-
expect_error(
734-
scale_x_continuous(limits = c("A", "B")),
735-
"not a character vector"
736-
)
737-
expect_error(
738-
scale_x_continuous(limits = 1:3),
739-
"length 2, not length 3"
740-
)
733+
expect_snapshot(scale_x_continuous(limits = c("A", "B")), error = TRUE)
734+
expect_snapshot(scale_x_continuous(limits = 1:3), error = TRUE)
741735
})
742736

743737
test_that("discrete scales work with NAs in arbitrary positions", {

0 commit comments

Comments
 (0)