tests/testthat/test-diffuse.R

test_that("blending works",{
  tally_log(1:3,2:4)->a
  expect_identical(
    matrix_tally(diffuse(a,blend=0)),
    matrix_tally(a))
  expect_identical(diffuse(a,blend=1),diffuse(a))
  expect_identical(
    as.numeric(matrix_tally(diffuse(a,blend=0.7))),
    c(0,1,0.7,0.7,0,0,1,0.7,0,0,0,1,0,0,0,0)
  )
})

Try the toporanga package in your browser

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

toporanga documentation built on Aug. 8, 2025, 6:15 p.m.