assertArrayEquals

Asserts that the associative arrays are equal.

  1. void assertArrayEquals(in T[] expected, in U[] actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)
  2. void assertArrayEquals(in T[V] expected, in U[V] actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)
    void
    assertArrayEquals
    (
    T
    U
    V
    )
    (
    in T[V] expected
    ,
    in U[V] actual
    ,
    lazy string msg = null
    ,
    string file = __FILE__
    ,
    size_t line = __LINE__
    )

Throws

AssertException otherwise

Examples

1 int[string] expected = ["foo": 1, "bar": 2];
2 
3 assertArrayEquals(expected, ["foo": 1, "bar": 2]);
4 
5 AssertException exception;
6 
7 exception = expectThrows!AssertException(assertArrayEquals(expected, ["foo": 2]));
8 assertEquals(`mismatch at key "foo"; expected: <1> but was: <2>`, exception.msg);
9 exception = expectThrows!AssertException(assertArrayEquals(expected, ["foo": 1]));
10 assertEquals(`key mismatch; difference: "bar"`, exception.msg);

Meta