shouldNotBeEmpty

Verify that aa is not empty.

  1. void shouldNotBeEmpty(R rng, in string file = __FILE__, in size_t line = __LINE__)
  2. void shouldNotBeEmpty(in auto ref T aa, in string file = __FILE__, in size_t line = __LINE__)
    void
    shouldNotBeEmpty
    (
    T
    )
    (
    in 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 assertFail(shouldNotBeEmpty(ints));
6 assertFail(shouldNotBeEmpty(strings));
7 assertFail(shouldNotBeEmpty(aa));
8 
9 ints ~= 1;
10 strings ~= "foo";
11 aa["foo"] = "bar";
12 
13 shouldNotBeEmpty(ints);
14 shouldNotBeEmpty(strings);
15 shouldNotBeEmpty(aa);

Meta