File: test-mark-properties.r

package info (click to toggle)
r-cran-ggvis 0.4.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,716 kB
  • sloc: sh: 25; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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")
})