1 // not pure because parseJSON isn't pure 2 import unit_threaded.asserts; 3 `{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo": "bar"}`); 4 `{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo":"bar"}`); 5 `{"foo":"bar"}`.shouldBeSameJsonAs(`{"foo": "baz"}`).shouldThrow!UnitTestException; 6 try 7 `oops`.shouldBeSameJsonAs(`oops`); 8 catch(Exception e) 9 assertEqual(e.msg, "Error parsing JSON: Unexpected character 'o'. (Line 1:1)");
If two strings represent the same JSON regardless of formatting