1'use strict'; 2require('../common'); 3const assert = require('assert'); 4const httpCommon = require('_http_common'); 5const checkIsHttpToken = httpCommon._checkIsHttpToken; 6const checkInvalidHeaderChar = httpCommon._checkInvalidHeaderChar; 7 8// checkIsHttpToken 9assert(checkIsHttpToken('t')); 10assert(checkIsHttpToken('tt')); 11assert(checkIsHttpToken('ttt')); 12assert(checkIsHttpToken('tttt')); 13assert(checkIsHttpToken('ttttt')); 14 15assert.strictEqual(checkIsHttpToken(''), false); 16assert.strictEqual(checkIsHttpToken(' '), false); 17assert.strictEqual(checkIsHttpToken('あ'), false); 18assert.strictEqual(checkIsHttpToken('あa'), false); 19assert.strictEqual(checkIsHttpToken('aaaaあaaaa'), false); 20 21// checkInvalidHeaderChar 22assert(checkInvalidHeaderChar('あ')); 23assert(checkInvalidHeaderChar('aaaaあaaaa')); 24 25assert.strictEqual(checkInvalidHeaderChar(''), false); 26assert.strictEqual(checkInvalidHeaderChar(1), false); 27assert.strictEqual(checkInvalidHeaderChar(' '), false); 28assert.strictEqual(checkInvalidHeaderChar(false), false); 29assert.strictEqual(checkInvalidHeaderChar('t'), false); 30assert.strictEqual(checkInvalidHeaderChar('tt'), false); 31assert.strictEqual(checkInvalidHeaderChar('ttt'), false); 32assert.strictEqual(checkInvalidHeaderChar('tttt'), false); 33assert.strictEqual(checkInvalidHeaderChar('ttttt'), false); 34