tests/testthat/helper-utils.R

compressed_css <- function(x) {
  gsub("\\s+|\\n", "", paste(as.character(x), collapse = ""))
}

expect_css <- function(input, css, output = NULL, ...) {
  res <- sass(input, output = output, ...)
  if (!is.null(output)) {
    res <- read_utf8(res)
  }
  expect_identical(
    compressed_css(res),
    compressed_css(css)
  )
}

Try the sass package in your browser

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

sass documentation built on May 29, 2024, 11:51 a.m.