mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

PR-URL: https://github.com/nodejs/node/pull/8643 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@keybase.io>
21 lines
471 B
JavaScript
21 lines
471 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const debug = require('_debugger');
|
|
|
|
const protocol = new debug.Protocol();
|
|
|
|
assert.strictEqual(protocol.state, 'headers');
|
|
|
|
protocol.execute('Content-Length: 10\r\n\r\nfhqwhgads');
|
|
|
|
assert.strictEqual(protocol.state, 'body');
|
|
assert.strictEqual(protocol.res.body, undefined);
|
|
|
|
protocol.state = 'sterrance';
|
|
assert.throws(
|
|
() => { protocol.execute('grumblecakes'); },
|
|
/^Error: Unknown state$/
|
|
);
|