tests/testthat/test_aggreg_function.R

context("AggregFunction")

test_that("test aggreg function", {
  leaf1 <- Node$new("l1")
  leaf1$sat <- 0.25
  leaf2 <- Node$new("l2")
  leaf2$sat <- 0.75
  aggreg_function <- NewAggregFunction(mean)
  node <- Node$new("ag")
  node$AddChildNode(leaf1)
  node$AddChildNode(leaf2)
  expect_equal(Aggreg(aggreg_function, node, "sat"), 0.5)
})

Try the GeoFIS package in your browser

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

GeoFIS documentation built on Oct. 5, 2022, 5:06 p.m.