@ -1,7 +1,7 @@
'use strict' ;
// test compression/decompression with dictionary
require ( '../common' ) ;
const common = require ( '../common' ) ;
const assert = require ( 'assert' ) ;
const zlib = require ( 'zlib' ) ;
@ -32,6 +32,7 @@ function basicDictionaryTest() {
let output = '' ;
const deflate = zlib . createDeflate ( { dictionary : spdyDict } ) ;
const inflate = zlib . createInflate ( { dictionary : spdyDict } ) ;
inflate . setEncoding ( 'utf-8' ) ;
deflate . on ( 'data' , function ( chunk ) {
inflate . write ( chunk ) ;
@ -45,9 +46,9 @@ function basicDictionaryTest() {
inflate . end ( ) ;
} ) ;
inflate . on ( 'end' , function ( ) {
assert . e qual( input , output ) ;
} ) ;
inflate . on ( 'end' , common . mustCall ( function ( ) {
assert . strictE qual( input , output ) ;
} ) ) ;
deflate . write ( input ) ;
deflate . end ( ) ;
@ -58,6 +59,7 @@ function deflateResetDictionaryTest() {
let output = '' ;
const deflate = zlib . createDeflate ( { dictionary : spdyDict } ) ;
const inflate = zlib . createInflate ( { dictionary : spdyDict } ) ;
inflate . setEncoding ( 'utf-8' ) ;
deflate . on ( 'data' , function ( chunk ) {
if ( doneReset )
@ -72,9 +74,9 @@ function deflateResetDictionaryTest() {
inflate . end ( ) ;
} ) ;
inflate . on ( 'end' , function ( ) {
assert . e qual( input , output ) ;
} ) ;
inflate . on ( 'end' , common . mustCall ( function ( ) {
assert . strictE qual( input , output ) ;
} ) ) ;
deflate . write ( input ) ;
deflate . flush ( function ( ) {
@ -89,6 +91,7 @@ function rawDictionaryTest() {
let output = '' ;
const deflate = zlib . createDeflateRaw ( { dictionary : spdyDict } ) ;
const inflate = zlib . createInflateRaw ( { dictionary : spdyDict } ) ;
inflate . setEncoding ( 'utf-8' ) ;
deflate . on ( 'data' , function ( chunk ) {
inflate . write ( chunk ) ;
@ -102,9 +105,9 @@ function rawDictionaryTest() {
inflate . end ( ) ;
} ) ;
inflate . on ( 'end' , function ( ) {
assert . e qual( input , output ) ;
} ) ;
inflate . on ( 'end' , common . mustCall ( function ( ) {
assert . strictE qual( input , output ) ;
} ) ) ;
deflate . write ( input ) ;
deflate . end ( ) ;
@ -115,6 +118,7 @@ function deflateRawResetDictionaryTest() {
let output = '' ;
const deflate = zlib . createDeflateRaw ( { dictionary : spdyDict } ) ;
const inflate = zlib . createInflateRaw ( { dictionary : spdyDict } ) ;
inflate . setEncoding ( 'utf-8' ) ;
deflate . on ( 'data' , function ( chunk ) {
if ( doneReset )
@ -129,9 +133,9 @@ function deflateRawResetDictionaryTest() {
inflate . end ( ) ;
} ) ;
inflate . on ( 'end' , function ( ) {
assert . e qual( input , output ) ;
} ) ;
inflate . on ( 'end' , common . mustCall ( function ( ) {
assert . strictE qual( input , output ) ;
} ) ) ;
deflate . write ( input ) ;
deflate . flush ( function ( ) {