tests/testthat/test-mark-properties.r

context("Mark: properties")

test_that("check_mark_props returns true if all ok", {
  expect_true(check_mark_props("symbol", c("x", "y", "stroke")))
  expect_true(check_mark_props("rect", c("x", "x2", "y", "y2")))
})

test_that("check_mark_props returns helpful suggestion for single incorrect", {
  expect_error(check_mark_props("symbol", "Stroke"), "stroke")
  expect_error(check_mark_props("symbol", "strke"), "stroke")
})

test_that("check_mark_props doesn't give suggestion if really wrong", {
  expect_error(check_mark_props("symbol", "asdfasdfdsa"), "Unknown properties")
})


test_that("check_mark_props returns helpful suggestion for mixture", {
  expect_error(check_mark_props("symbol", c("x", "Stroke")), "stroke")
  expect_error(check_mark_props("symbol", c("x", "strke")), "stroke")
})

Try the ggvis package in your browser

Any scripts or data that you put into this service are public.

ggvis documentation built on May 29, 2024, 1:12 a.m.