tests/testthat/test-search_trials.R

library(testthat)
library(dplyr)

test_that("Number of rows matches page_size", {
  # Define a page size to test with
  test_page_size <- 1

  # Call the function with the test page size
  result <- ctg_get_fields(status = "RECRUITING", page_size = test_page_size)

  # Check if the number of rows in the result matches the page size
  expect_equal(nrow(result), test_page_size,
               info = paste("Expected", test_page_size, "rows but got", nrow(result)))
})

Try the clintrialx package in your browser

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

clintrialx documentation built on April 3, 2025, 6:47 p.m.