tests/testthat/test-find-s7.R

test_that("methods_find finds S7 methods", {
  local_load_all("testS7")
  result <- methods_find("uni")
  expect_equal(result$class, c("character", "integer"))
  expect_equal(result$package, rep("testS7", 2))
  expect_equal(result$topic, c("uni-character-method", "uni"))
})

test_that("methods_find finds S7 multi-dispatch methods", {
  local_load_all("testS7")
  result <- methods_find("multi")
  expect_equal(result$class, c("character,integer", "integer,character"))
  expect_equal(result$package, rep("testS7", 2))
  expect_equal(result$topic, c("multi-character-integer-method", "multi"))
})

test_that("S7 methods_list output", {
  local_load_all("testS7")
  expect_snapshot(cat(methods_list("uni")))
})

test_that("S7 multi-dispatch methods_list output", {
  local_load_all("testS7")
  expect_snapshot(cat(methods_list("multi")))
})

Try the doclisting package in your browser

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

doclisting documentation built on April 15, 2026, 5:07 p.m.