test_that("parula returns hex colours", {
  cols <- parula_colors(8)
  expect_length(cols, 8)
  expect_match(cols, "^#[0-9A-Fa-f]{6}$")
})

test_that("qqkrls produces a result on small data", {
  skip_if_not_installed("KRLS")
  set.seed(1); n <- 80
  x <- rnorm(n); y <- 0.4 * x + rnorm(n, sd = 0.4)
  fit <- qqkrls(y, x,
                y_quantiles = c(0.25, 0.5, 0.75),
                x_quantiles = c(0.5, 0.75),
                n_boot = 5, verbose = FALSE)
  expect_s3_class(fit, "qqkrls")
  expect_equal(nrow(fit$results), 6)
  M <- qqkrls_to_matrix(fit)
  expect_equal(dim(M), c(3, 2))
})
