X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2FOutput_JSONStream.t;h=13702a65f6ecfcdaa3b0dfa641c2664499221080;hb=58b5b384f64178cfc9e90c693a32dada484f06de;hp=1d0cf35646282c2a656e414227696d161ce11722;hpb=4656f3230540838308627c58370849efde5db8f6;p=koha_fer diff --git a/t/Output_JSONStream.t b/t/Output_JSONStream.t index 1d0cf35646..13702a65f6 100755 --- a/t/Output_JSONStream.t +++ b/t/Output_JSONStream.t @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 10; BEGIN { use_ok('C4::Output::JSONStream'); @@ -17,14 +17,16 @@ is($json->output,'{}',"Making sure JSON output is blank just after its created." $json->param( issues => [ 'yes!', 'please', 'no' ] ); is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to."); $json->param( stuff => ['realia'] ); -is($json->output,'{"issues":["yes!","please","no"],"stuff":["realia"]}',"Making sure JSON output has added more params correctly."); +like($json->output,'/"stuff":\["realia"\]/',"Making sure JSON output has added more params correctly."); +like($json->output,'/"issues":\["yes!","please","no"\]/',"Making sure existing elements remain in JSON output"); $json->param( stuff => ['fun','love'] ); -is($json->output,'{"issues":["yes!","please","no"],"stuff":["fun","love"]}',"Making sure JSON output can obverwrite params."); +like($json->output,'/"stuff":\["fun","love"\]/',"Making sure JSON output can overwrite params."); +like($json->output,'/"issues":\["yes!","please","no"\]/',"Making non overwitten elements remain in JSON output"); eval{$json->param( die )}; ok($@,'Dies'); eval{$json->param( die => ['yes','sure','now'])}; -ok(!$@,'Dosent die.'); +ok(!$@,'Does not die.'); eval{$json->param( die => ['yes','sure','now'], die2 =>)}; ok($@,'Dies.');