shouldBeSameJsonAs

If two strings represent the same JSON regardless of formatting

@trusted
void
shouldBeSameJsonAs
(
in string actual
,
in string expected
,
in string file = __FILE__
,
in size_t line = __LINE__
)

Examples

// not pure because parseJSON isn't pure
   `{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo": "bar"}`);
   `{"foo":    "bar"}`.shouldBeSameJsonAs(`{"foo":"bar"}`);
   `{"foo":"bar"}`.shouldBeSameJsonAs(`{"foo": "baz"}`).shouldThrow!UnitTestException;

Meta