Expectation::toBeSorted
Member of Expectation
idl
Expectation.toBeSorted, $
/_expect_failure, $
/descendingVerifies that the expectation value (an array or list of real numbers or strings) is sorted. Equal neighbors are allowed, and arrays with fewer than two elements are always sorted. Multi dimensional arrays are checked in memory order.
Examples
idl
(it.expects([1, 2, 2, 3])).toBeSorted
(it.expects([3, 2, 1])).toBeSorted, /descending
(it.expects(['b', 'a']))._not_.toBeSortedKeywords
_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.
descending
optionalinputtype=BooleanSet this keyword to check for descending order instead.