tests/testthat/test_adjustHeight.r

context("test_adjustHeight")

test_that("Test adding no height", {
  data(sinkhole)
  expect_equal(sinkhole@profiles[[1]], adjustHeight(sinkhole@profiles[[1]], 0))
})

test_that("Test adding height works", {
  data(sinkhole)
  expect_s4_class(adjustHeight(sinkhole@profiles[[1]], 10), "Profile")
  p_new <- adjustHeight(sinkhole@profiles[[1]], 10)
  expect_identical(p_new@processedData@pointsWithTopo$height, sinkhole@profiles[[1]]@processedData@pointsWithTopo$height + 10)
})

Try the geoelectrics package in your browser

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

geoelectrics documentation built on Feb. 16, 2023, 8:06 p.m.