File: test-plot.R

package info (click to toggle)
r-cran-ggplot2 4.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,084 kB
  • sloc: sh: 15; makefile: 5
file content (13 lines) | stat: -rw-r--r-- 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
test_that("ggplot() throws informative errors", {
  expect_snapshot_error(ggplot(mapping = letters))
  expect_snapshot_error(ggplot(data))
  expect_snapshot_warning(ggplot(foobar = "nonsense"))
})

test_that("construction have user friendly errors", {
  skip_if(getRversion() < "4.3.0")
  expect_snapshot_error(+ geom_point())
  expect_snapshot_error(geom_point() + geom_bar())
  expect_snapshot_error(ggplot() + 1)
  expect_snapshot_error(ggplot() + geom_point)
})