(a, b)
| 418 | ); |
| 419 | |
| 420 | function test(a, b) { |
| 421 | const onHeadersComplete = mustCall((versionMajor, versionMinor, headers, |
| 422 | method, url) => { |
| 423 | assert.strictEqual(method, methods.indexOf('POST')); |
| 424 | assert.strictEqual(url || parser.url, '/helpme'); |
| 425 | assert.strictEqual(versionMajor, 1); |
| 426 | assert.strictEqual(versionMinor, 1); |
| 427 | }); |
| 428 | |
| 429 | let expected_body = '123123456123456789123456789ABC123456789ABCDEF'; |
| 430 | |
| 431 | const onBody = mustCallAtLeast((buf) => { |
| 432 | const chunk = String(buf); |
| 433 | assert.strictEqual(expected_body.indexOf(chunk), 0); |
| 434 | expected_body = expected_body.slice(chunk.length); |
| 435 | }); |
| 436 | |
| 437 | const parser = newParser(REQUEST); |
| 438 | parser[kOnHeadersComplete] = mustCall(onHeadersComplete); |
| 439 | parser[kOnBody] = onBody; |
| 440 | parser.execute(a, 0, a.length); |
| 441 | parser.execute(b, 0, b.length); |
| 442 | |
| 443 | assert.strictEqual(expected_body, ''); |
| 444 | } |
| 445 | |
| 446 | for (let i = 1; i < request.length - 1; ++i) { |
| 447 | const a = request.slice(0, i); |
no test coverage detected
searching dependent graphs…