shouldBeEmpty

Used to assert that Range is empty.

  1. void shouldBeEmpty(in auto ref R rng, in string message = null, in string file = __FILE__, in size_t line = __LINE__)
    void
    shouldBeEmpty
    (
    R
    )
    (
    in auto ref R rng
    ,
    in string message = null
    ,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
    if (
    isInputRange!R
    )
  2. void shouldBeEmpty(auto ref T aa, in string message = null, in string file = __FILE__, in size_t line = __LINE__)

Parameters

rng
Type: R

The expected Range.

message
Type: string

Exception message.

file
Type: string

The file name that the assert failed in. Should be left as default.

line
Type: size_t

The file line that the assert failed in. Should be left as default.

Throws

If the Range is not empty, will throw an UnitTestException with expected and actual values.

Examples

// Will throw an exception like "UnitTestException@example.d(6): Expected empty Range, but got <[1]>"
[1].shouldBeEmpty();

Meta