Debian Codegraph @

t/10_settings.t

raw
1 use strict;
2 use warnings;
3 use Test::More;
4 use lib 't/lib';
5 use PH2Test;
6 use Protocol::HTTP2::Constants qw(:settings);
7 use Protocol::HTTP2::Client;
8 use Protocol::HTTP2::Server;
9
10 subtest 'client settings' => sub {
11
12 my $c =
13 Protocol::HTTP2::Client->new(
14 settings => { &SETTINGS_HEADER_TABLE_SIZE => 100 } );
15 $c->request(
16 ':scheme' => 'http',
17 ':authority' => 'localhost:8000',
18 ':path' => '/',
19 ':method' => 'GET',
20 );
21
22 # PRI
23 $c->next_frame;
24
25 # SETTINGS
26 ok binary_eq( hstr('0000 0604 0000 0000 0000 0100 0000 64'),
27 $c->next_frame ),
28 "send only changed from default values settings";
29 };
30
31 subtest 'server settings' => sub {
32
33 my $s = Protocol::HTTP2::Server->new;
34
35 ok binary_eq( hstr('0000 0604 0000 0000 0000 0300 0000 64'),
36 $s->next_frame ), "server defaults not empty";
37 };
38
39 done_testing;