shouldBeEmpty

Verify that aa is empty.

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

Throws

UnitTestException on failure.

Examples

1 int[] ints;
2 string[] strings;
3 string[string] aa;
4 
5 shouldBeEmpty(ints);
6 shouldBeEmpty(strings);
7 shouldBeEmpty(aa);
8 
9 ints ~= 1;
10 strings ~= "foo";
11 aa["foo"] = "bar";
12 
13 assertFail(shouldBeEmpty(ints));
14 assertFail(shouldBeEmpty(strings));
15 assertFail(shouldBeEmpty(aa));

Meta