File: 10_settings.t

package info (click to toggle)
libprotocol-http2-perl 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: perl: 3,370; makefile: 7
file content (39 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use PH2Test;
use Protocol::HTTP2::Constants qw(:settings);
use Protocol::HTTP2::Client;
use Protocol::HTTP2::Server;

subtest 'client settings' => sub {

    my $c =
      Protocol::HTTP2::Client->new(
        settings => { &SETTINGS_HEADER_TABLE_SIZE => 100 } );
    $c->request(
        ':scheme'    => 'http',
        ':authority' => 'localhost:8000',
        ':path'      => '/',
        ':method'    => 'GET',
    );

    # PRI
    $c->next_frame;

    # SETTINGS
    ok binary_eq( hstr('0000 0604 0000 0000 0000 0100 0000 64'),
        $c->next_frame ),
      "send only changed from default values settings";
};

subtest 'server settings' => sub {

    my $s = Protocol::HTTP2::Server->new;

    ok binary_eq( hstr('0000 0604 0000 0000 0000 0300 0000 64'),
        $s->next_frame ), "server defaults not empty";
};

done_testing;