shouldNotBeEmpty

Verify that aa is not empty.

  1. void shouldNotBeEmpty(R rng, string file, size_t line)
  2. void shouldNotBeEmpty(T aa, string file, size_t line)
    @safe
    void
    shouldNotBeEmpty
    (
    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;

assertFail(shouldNotBeEmpty(ints));
assertFail(shouldNotBeEmpty(strings));
assertFail(shouldNotBeEmpty(aa));

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

shouldNotBeEmpty(ints);
shouldNotBeEmpty(strings);
shouldNotBeEmpty(aa);

Meta