File: test-layer.r

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

test_that("Bare name surround by .. is calculated", {
  expect_true(is_calculated_aes(aes(..density..)))
  expect_true(is_calculated_aes(aes(..DENSITY..)))
  expect_false(is_calculated_aes(aes(a..x..b)))
})

test_that("Calling using variable surround by .. is calculated", {
  expect_true(is_calculated_aes(aes(mean(..density..))))
  expect_true(is_calculated_aes(aes(mean(..DENSITY..))))
  expect_false(is_calculated_aes(aes(x=mean(a..x..b))))
})

test_that("strip_dots remove dots around calculated aesthetics", {
  expect_equal(strip_dots(aes(x=..density..))$x, quote(density))
  expect_equal(strip_dots(aes(mean(..density..)))$x, quote(mean(density)))
})