tests/testthat/test-code.R

test_that("document", {
  skip_on_cran()
  expect_length(httr2::with_mock(cache_response, document_code("1 + 1", progress = FALSE)), 1L)
})

test_that("annotate", {
  skip_on_cran()
  expect_length(httr2::with_mock(cache_response, annotate_code("1 + 1", progress = FALSE)), 1L)
})

test_that("explain", {
  skip_on_cran()
  expect_length(httr2::with_mock(cache_response, explain_code("1 + 1", progress = FALSE)), 8L)
})

test_that("test", {
  skip_on_cran()
  expect_length(httr2::with_mock(cache_response, test_function("1 + 1", progress = FALSE)), 8L)
})

Try the askgpt package in your browser

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

askgpt documentation built on Sept. 8, 2023, 5:42 p.m.