File: test-layout_manipulate.R

package info (click to toggle)
r-cran-graphlayouts 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,660 kB
  • sloc: cpp: 696; sh: 13; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
test_that("layout_manipulate works", {
  xy <- cbind(c(0,0,0,0),c(1,2,3,4))
  xynew <- layout_mirror(layout_mirror(xy,axis = "horizontal"),axis = "horizontal")
  expect_true(all(xynew==xy))
  xynew <- layout_mirror(layout_mirror(xy,axis = "vertical"),axis = "vertical")
  expect_true(all(xynew==xy))

  expect_error(layout_mirror(xy,"diagonal"))
  expect_error(layout_mirror(c(1,1),"horizontal"))

  expect_equal(layout_rotate(xy,180)[,2],c(-1,-2,-3,-4))
  expect_error(layout_rotate(c(1,1),70))
  expect_error(layout_rotate(xy,"70"))
})