AssertException otherwise
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);
Asserts that the associative arrays are equal.