comparison h2_proxy_ssl.t @ 948:4dc302d8e04f

Tests: changed HTTP2 package to act as a class. Stopped exporting any subroutines. A subset of them now act as class methods.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 17 Jun 2016 11:36:33 +0300
parents 266e3b2e88f9
children e9064d691790
comparison
equal deleted inserted replaced
947:b9e42c554ba7 948:4dc302d8e04f
14 14
15 BEGIN { use FindBin; chdir($FindBin::Bin); } 15 BEGIN { use FindBin; chdir($FindBin::Bin); }
16 16
17 use lib 'lib'; 17 use lib 'lib';
18 use Test::Nginx; 18 use Test::Nginx;
19 use Test::Nginx::HTTP2 qw/ :DEFAULT :frame /; 19 use Test::Nginx::HTTP2;
20 20
21 ############################################################################### 21 ###############################################################################
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
84 # "zero size buf in output" alerts seen 84 # "zero size buf in output" alerts seen
85 85
86 TODO: { 86 TODO: {
87 local $TODO = 'not yet' unless $t->has_version('1.9.14'); 87 local $TODO = 'not yet' unless $t->has_version('1.9.14');
88 88
89 my $sess = new_session(); 89 my $s = Test::Nginx::HTTP2->new();
90 my $sid = new_stream($sess, { path => '/proxy_ssl/', body_more => 1 }); 90 my $sid = $s->new_stream({ path => '/proxy_ssl/', body_more => 1 });
91 h2_body($sess, ''); 91 $s->h2_body('');
92 my $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 92 my $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
93 93
94 my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 94 my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
95 is($frame->{headers}->{':status'}, 200, 'empty request body'); 95 is($frame->{headers}->{':status'}, 200, 'empty request body');
96 96
97 } 97 }