File: test-error.R

package info (click to toggle)
r-cran-ggplot2 3.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,184 kB
  • sloc: sh: 15; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
context("error")

test_that("various misuses of +.gg (#2638)", {
  expect_error(
    {
      ggplot(mtcars, aes(hwy, displ))
      + geom_point()
    },
    "Cannot use `+.gg()` with a single argument. Did you accidentally put + on a new line?",
    fixed = TRUE
  )

  expect_error(
    geom_point() + geom_point(),
    "Cannot add ggproto objects together. Did you forget to add this object to a ggplot object?",
    fixed = TRUE
  )
})