Skip to content

Commit d945e20

Browse files
committed
replace expect_warning()
1 parent 56b5319 commit d945e20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+414
-179
lines changed

tests/testthat/_snaps/aes-calculated.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
Duplicated aesthetics after name standardisation: colour
88

9+
# calculated aesthetics throw warnings when lengths mismatch
10+
11+
Failed to apply `after_stat()` for the following aesthetic: colour.
12+
13+
---
14+
15+
Failed to apply `after_scale()` for the following aesthetic: colour.
16+
917
# A deprecated warning is issued when stat(var) or ..var.. is used
1018

1119
`stat(foo)` was deprecated in ggplot2 3.4.0.

tests/testthat/_snaps/aes.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@
99
Caused by error:
1010
! object 'foo' not found
1111

12+
# aes standardises aesthetic names
13+
14+
Duplicated aesthetics after name standardisation: colour
15+
16+
# warn_for_aes_extract_usage() warns for discouraged uses of $ and [[ within aes()
17+
18+
Use of `df$x` is discouraged.
19+
i Use `x` instead.
20+
21+
---
22+
23+
Use of `df[["x"]]` is discouraged.
24+
i Use `.data[["x"]]` instead.
25+
26+
---
27+
28+
Use of `df$x` is discouraged.
29+
i Use `x` instead.
30+
31+
# warn_for_aes_extract_usage() does not evaluate function calls
32+
33+
Use of `df$x` is discouraged.
34+
i Use `x` instead.
35+
36+
# Warnings are issued when plots use discouraged extract usage within aes()
37+
38+
Use of `df$x` is discouraged.
39+
i Use `x` instead.
40+
1241
# aes evaluation fails with unknown input
1342

1443
Unknown input: <environment>

tests/testthat/_snaps/coord-transform.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# warnings are generated when coord_trans() results in new infinite values
2+
3+
Transformation introduced infinite values in y-axis
4+
5+
---
6+
7+
Transformation introduced infinite values in x-axis
8+
19
# coord_trans() throws error when limits are badly specified
210

311
`xlim` must be a vector of length 2, not a <ScaleContinuousPosition> object.

tests/testthat/_snaps/facet-labels.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@
1414
Error in `labeller()`:
1515
! Conflict between `.cols` and `cyl`.
1616

17+
# old school labellers still work
18+
19+
The `labeller` API has been updated. Labellers taking `variable` and `value` arguments are now deprecated.
20+
i See labellers documentation.
21+

tests/testthat/_snaps/geom-bar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# geom_bar removes bars with parts outside the plot limits
2+
3+
Removed 1 row containing missing values or values outside the scale range (`geom_bar()`).
4+

tests/testthat/_snaps/geom-boxplot.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# geom_boxplot for continuous x gives warning if more than one x (#992)
2+
3+
Continuous x aesthetic
4+
i did you forget `aes(group = ...)`?
5+
6+
---
7+
8+
Continuous x aesthetic
9+
i did you forget `aes(group = ...)`?
10+
11+
---
12+
13+
Continuous x aesthetic
14+
i did you forget `aes(group = ...)`?
15+
116
# boxplots with a group size >1 error
217

318
Can only draw one boxplot per group.

tests/testthat/_snaps/geom-col.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# geom_col removes columns with parts outside the plot limits
2+
3+
Removed 3 rows containing missing values or values outside the scale range (`geom_col()`).
4+
5+
---
6+
7+
Removed 1 row containing missing values or values outside the scale range (`geom_col()`).
8+

tests/testthat/_snaps/geom-dotplot.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@
1414
Caused by error in `compute_group()`:
1515
! `weight` must be nonnegative integers, not a double vector.
1616

17+
# geom_dotplot draws correctly
18+
19+
Removed 2 rows containing missing values or values outside the scale range (`stat_bindot()`).
20+
21+
---
22+
23+
Removed 2 rows containing missing values or values outside the scale range (`stat_bindot()`).
24+

tests/testthat/_snaps/geom-path.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
Error in `stairstep()`:
1414
! `direction` must be one of "hv", "vh", or "mid", not "invalid".
1515

16+
# NA linetype is dropped with warning
17+
18+
Removed 2 rows containing missing values or values outside the scale range (`geom_path()`).
19+

tests/testthat/_snaps/geom-rug.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
Caused by error in `draw_panel()`:
66
! `length` must be a <unit> object, not the number 0.01.
77

8+
# geom_rug() warns about missing values when na.rm = FALSE
9+
10+
Removed 2 rows containing missing values or values outside the scale range (`geom_rug()`).
11+

0 commit comments

Comments
 (0)