LP#1285915: document that perl2JSON doesn't order hash keys user/gmcharlt/lp1285915_hash_randomization_test_failure
authorGalen Charlton <gmc@esilibrary.com>
Wed, 2 Apr 2014 22:24:06 +0000 (15:24 -0700)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 2 Apr 2014 22:24:56 +0000 (15:24 -0700)
commit2813083e3ef5c93d7c791d041d98ce51b10da9f3
tree9688f81d74dcc1dcb107d562a97c80c160077473
parent951d97a32db426874c4bb6314e473660d765f302
LP#1285915: document that perl2JSON doesn't order hash keys

This patch documents that JSON strings returned by
OpenSRF::Utils::JSON->perl2JSON() should not be expected to have
hash keys sorted in any particular order.  It also adjusts a
corresponding test case to consistently pass under Perl 5.18, which
introduces hash order randomization.

Forcing JSON output to be in canonical form is another option, and
easily done by JSON::XS, but would add overhead.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
src/perl/lib/OpenSRF/Utils/JSON.pm
src/perl/t/09-Utils-JSON.t