shlist

share and manage lists between multiple people
Log | Files | Refs

bad_payloads.t (529B)


      1 use strict;
      2 use Test;
      3 use SL::Test;
      4 
      5 BEGIN { plan tests => 2 }
      6 
      7 my $s = SL::Test::Server->new();
      8 
      9 # Send a straight up unparsable json string
     10 my $client = SL::Test::Client->new(1);
     11 $client->send_all(pack('nnnZ*', 0, 0, 2, "{"), 8);
     12 ok($s->readline(), "/expected, at character offset 1 \\(before \"/");
     13 
     14 # Send an empty array back (which is valid json but we don't use this)
     15 $client = SL::Test::Client->new(1);
     16 $client->send_all(pack('nnnZ*', 0, 0, 2, "[]"), 9);
     17 ok($s->readline(), '/json payload didn\'t have dictionary root/');