Subject: | hash order assumption in t/rpc04-json_opt.t fails |
Distribution: JSON-1.00.tar.gz
Perl verion: This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(with 1 registered patch, see perl -V for more detail)
OS: Darwin 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc (Mac OS 10.3.9)
Line 23 of t/rpc04-json_opt.t assumes an order of an unordered hash:
is($q->param('json'),'{"params":[true,false,null],"id":"httpReq","method":"echo"}' );
When I run a make test, I get:
t/rpc04-json_opt.....NOK 1
# Failed test (t/rpc04-json_opt.t at line 23)
# got: '{"id":"httpReq","method":"echo","params":[true,false,null]}'
# expected: '{"params":[true,false,null],"id":"httpReq","method":"echo"}'
I think the issue is that the sub objToJson has no way of knowing (or should it know) the order of the keys on an incomming hash.
This is also the reason that the 1.00 tests failed on 5.8.1 on Freebsd 5.4-stable (i386-freebsd).