shouldBeEmpty

Verify that aa is empty.

  1. void shouldBeEmpty(R rng, string file, size_t line)
  2. void shouldBeEmpty(T aa, string file, size_t line)
    void
    shouldBeEmpty
    (
    T
    )
    (
    in T aa
    ,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
    if (
    isAssociativeArray!T
    )

Throws

UnitTestException on failure.

Examples

int[] ints;
string[] strings;
string[string] aa;

shouldBeEmpty(ints);
shouldBeEmpty(strings);
shouldBeEmpty(aa);

ints ~= 1;
strings ~= "foo";
aa["foo"] = "bar";

assertFail(shouldBeEmpty(ints));
assertFail(shouldBeEmpty(strings));
assertFail(shouldBeEmpty(aa));

Meta