expect_subset: Extra test functions

View source: R/extra-test.R

expect_subsetR Documentation

Extra test functions

Description

Extra test functions

Usage

expect_subset(
  object,
  expected,
  info = NULL,
  label = NULL,
  expected.label = NULL
)

Arguments

object

object to test

expected

Expected value

info

extra information to be included in the message (useful when writing tests in loops).

label

object label. When 'NULL', computed from deparsed object.

expected.label

Equivalent of 'label' for shortcut form.

Value

Returns the object itself if expected value is found in the object as a subset else return Error

Examples

expect_subset(c(1, 2, 3, 4, 5), c(2, 4, 5))

simulatr/simrel documentation built on Nov. 19, 2022, 7:05 a.m.