# WARNING - Generated by {fusen} from dev/flat_kwb_simulate_inflow.Rmd: do not edit by hand # nolint: line_length_linter.

test_that("noSuchElements works correctly", {
  # Test with single missing element
  expect_equal(
    noSuchElements("x", c("a", "b", "c")),
    "No such element:\n- 'x'\nAvailable elements (sorted):\n- 'a'\n- 'b'\n- 'c'\n"
  )

  # Test with multiple missing elements
  expect_equal(
    noSuchElements(c("x", "y"), c("a", "b", "c"), suffix = "s"),
    "No such elements (sorted)s:\n- 'x'\n- 'y'\nAvailable elements (sorted):\n- 'a'\n- 'b'\n- 'c'\n"
  )

  # Test with sorted = FALSE
  expect_equal(
    noSuchElements("b", c("a", "c"), type = "item", sorted = FALSE),
    "No such item:\n- 'b'\nAvailable items:\n- 'a'\n- 'c'\n"
  )

  # Test with numeric vectors
  expect_equal(
    noSuchElements(4, 1:3),
    "No such element:\n- 4\nAvailable elements (sorted):\n- 1\n- 2\n- 3\n"
  )

  # Test with logical vectors
  expect_equal(
    noSuchElements(TRUE, c(FALSE, TRUE)),
    "No such element:\n- TRUE\nAvailable elements (sorted):\n- FALSE\n- TRUE\n"
  )
})
