Bug 11480: Fix invalid assumptions in JSONStream test
authorColin Campbell <colin.campbell@ptfs-europe.com>
Mon, 6 Jan 2014 16:53:33 +0000 (16:53 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 10 Jan 2014 15:42:17 +0000 (15:42 +0000)
commit732ad864f66b2cc729e6fb6bdba8611e4f40fbd9
tree98b8605f9a88ba626889e64eb11a620b84d84961
parentfebd0312f8623c9861bd70dd61aa3fd47afb1b51
Bug 11480: Fix invalid assumptions in JSONStream test

Tests for C4::Output::JSONStream made the invalid assumption
that the hash keys of the modules internal structure
will always be returned in the same sequence.
A hash is an unordered structure. as of perl 5.18
this has beem reinforced by random seeding of the
hashing function. See the info in perldelta and
the doc for JSON.

This patch changes the tests to be sequence-neutral
where the previous test was testing that a new element
was added and an existing one was untouched these have
been separated into individual tests.

Some typos in the messages have been corrected

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Test Plan

1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail,
   but inconsistently under perl 5.18 or greater)
2/ Apply patch
3/ Run t/Output_JSONStream.t 10 tests should pass now

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/Output_JSONStream.t