Assertion.sorted

Asserts whether a forward range is sorted.

struct Assertion(T)
@trusted
static if(isForwardRange!T && __traits(compiles, context.isSorted))
bool
sorted
(
string file = __FILE__
,
size_t line = __LINE__
)

Examples

[1, 2, 3, 4].should.be.sorted;
[1, 2, 0, 4].should.not.be.sorted;

Meta