tests/testthat/test-front_edge.R

##
## test-front_edge.R - Edge point tests
##

context("front_edge")

## Predeclare some simple test fronts:
front_2d <- matrix(c(0.0, 1.0, 0.5,
                     1.0, 0.0, 0.5),
                   nrow=2, byrow=TRUE)

front_3d <- matrix(c(0.0, 1.0, 0.0, 0.5, 0.7, 1.0, 1.0, 0.5,
                     0.0, 0.0, 1.0, 0.5, 0.5, 1.0, 0.5, 1.0,
                     1.0, 0.0, 0.0, 0.5, 0.3, 0.5, 1.0, 1.0),
                   nrow=3, byrow=TRUE)
which_points_on_edge(front_3d)

test_that("which_points_on_edge_2d", {
  expect_equal(which_points_on_edge(front_2d), c(1, 2))
})

test_that("which_points_on_edge_3d", {
  expect_equal(which_points_on_edge(front_3d), c(1, 2, 3, 6, 7, 8))
})
olafmersmann/emoa documentation built on Feb. 11, 2024, 11:24 p.m.