expect_backend = function(b) { checkmate::expect_r6(b, cloneable = FALSE, public = c("nrow", "ncol", "colnames", "rownames", "head", "data", "hash"), private = c(".data", ".hash", ".calculate_hash")) checkmate::expect_subset(b$data_formats, mlr3::mlr_reflections$data_formats, empty.ok = FALSE) testthat::expect_output(print(b), "^ 0 zero length ## missings are handled by distinct? d = b$distinct(rn, cn, na_rm = TRUE) checkmate::qexpectr(d, "V") d = b$distinct(rn, cn, na_rm = FALSE) m = b$missings(rn, cn) testthat::expect_equal(vapply(d, checkmate::anyMissing, FUN.VALUE = logical(1)), m > 0L) # $missings() x = b$missings(b$rownames, b$colnames) checkmate::expect_integerish(x, lower = 0L, upper = b$nrow, any.missing = FALSE) checkmate::expect_names(names(x), permutation.of = b$colnames) checkmate::expect_integerish(b$missings(b$rownames, "_not_existing_"), len = 0L, names = "named") checkmate::expect_integerish(b$missings(b$rownames[0L], b$colnames), len = b$ncol, names = "unique") checkmate::expect_integerish(b$missings(b$rownames[0L], "_not_existing_"), len = 0L, names = "unique") # $hash checkmate::expect_string(b$hash) }