expect_fields

Dict key / named List label assertion

Passes if a Dict’s keys or a named List’s labels match the given list of strings exactly (order-sensitive).

Parameters

Returns

Expect_pass when fields match; Expect_hold on NA; Expect_stop on errors or mismatch.

Examples

assert(expect_fields([a: 1, b = 2], ["a", "b"]))

See Also

expect_in, expect_colnames