Skip to content

Commit

Permalink
Avoid different hpack state of encoder and decoder in test
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Sep 5, 2023
1 parent 06e8d74 commit cde6bb9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/HPackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,16 @@ public function __toString()

public function testEncodeInteger(): void
{
$hpack = $this->createInstance();

for ($i = 1; $i < 1024; $i++) {
$hpack = $this->createInstance();

$input = [
['x', \str_repeat('.', $i)],
];

$encoded = $hpack->encode($input);
$decoder = $this->createInstance();

self::assertSame($input, $decoder->decode($encoded, 128000), 'Length ' . $i);
self::assertSame($input, $hpack->decode($encoded, 128000), 'Length ' . $i);
}

self::assertNotEmpty($encoded);
Expand Down

0 comments on commit cde6bb9

Please sign in to comment.