Created attachment 694
replacement for unittest of std.json
The only non-trivial unittest is commented out as "currently broken".
This is confusing: in fact, not the implementation but only the unittest is
broken.
The reason is, that the order of the name/value pairs in a JSON object is
unspecified:
the serialization uses foreach(name, member; value.object)!
The example just before the "currently broken" one is {"a":1,"b":null}:
as the result could also be {"b":null,"a":1}, this test is broken in theory,
but not (yet) in practice.
Please, consider to replace the broken unittest with the attached proposal.
Comment #1 by kroeplin.d — 2010-07-26T12:15:41Z
assert(find(json, result) != null, text(result, " should be in ", json));
should have been
assert(!find(json, result).empty, text(result, " should be in ", json));
Comment #2 by andrej.mitrovich — 2014-04-24T15:43:53Z