Expectation::toHaveLength
Member of Expectation
idl
Expectation.toHaveLength, length, $
/_expect_failureVerifies that the expectation value has a number of elements. Arrays and strings use idl n_elements() while lists, hashes, orderedhashes and dictionaries use their item count.
Examples
idl
(it.expects(findgen(100))).toHaveLength, 100
(it.expects(list(1, 2))).toHaveLength, 2
(it.expects(hash('a', 1)))._not_.toHaveLength, 2Arguments
length
requiredinputtype=IntSpecify the number of elements expected, zero or greater.
Keywords
_expect_failure {#kw-_expect_failure}
optionalinputtype=BooleanIf the test fails for some reason, set this to force passing because we expected failure. This keyword is for internal use only.