tests/testthat/test-Printable.R

test_that("Checks if Printable prints properly", {
  myPrintable <- R6::R6Class(
    "myPrintable",
    inherit = Printable,
    public = list(
      x = NULL,
      y = NULL,
      print = function() {
        private$printClass()
        private$printLine("x", self$x)
        private$printLine("y", self$y)
        invisible(self)
      }
    )
  )

  x <- myPrintable$new()
  expect_snapshot(x, cran = TRUE)
})

Try the ospsuite.utils package in your browser

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

ospsuite.utils documentation built on March 18, 2022, 6:44 p.m.