@@ -7,26 +7,27 @@ const zlib = require('zlib');
77const fs = require ( 'fs' ) ;
88const fixtures = require ( '../common/fixtures' ) ;
99
10- const abcEncoded = zlib . gzipSync ( 'abc' ) ;
11- const defEncoded = zlib . gzipSync ( 'def' ) ;
10+ const abc = 'abc' ;
11+ const def = 'def' ;
12+
13+ const abcEncoded = zlib . gzipSync ( abc ) ;
14+ const defEncoded = zlib . gzipSync ( def ) ;
1215
1316const data = Buffer . concat ( [
1417 abcEncoded ,
1518 defEncoded
1619] ) ;
1720
18- assert . strictEqual ( zlib . gunzipSync ( data ) . toString ( ) , 'abcdef' ) ;
21+ assert . strictEqual ( zlib . gunzipSync ( data ) . toString ( ) , ( abc + def ) ) ;
1922
2023zlib . gunzip ( data , common . mustCall ( ( err , result ) => {
2124 assert . ifError ( err ) ;
22- assert . strictEqual ( result . toString ( ) , 'abcdef' ,
23- 'result should match original string' ) ;
25+ assert . strictEqual ( result . toString ( ) , ( abc + def ) ) ;
2426} ) ) ;
2527
2628zlib . unzip ( data , common . mustCall ( ( err , result ) => {
2729 assert . ifError ( err ) ;
28- assert . strictEqual ( result . toString ( ) , 'abcdef' ,
29- 'result should match original string' ) ;
30+ assert . strictEqual ( result . toString ( ) , ( abc + def ) ) ;
3031} ) ) ;
3132
3233// Multi-member support does not apply to zlib inflate/deflate.
@@ -35,8 +36,7 @@ zlib.unzip(Buffer.concat([
3536 zlib . deflateSync ( 'def' )
3637] ) , common . mustCall ( ( err , result ) => {
3738 assert . ifError ( err ) ;
38- assert . strictEqual ( result . toString ( ) , 'abc' ,
39- 'result should match contents of first "member"' ) ;
39+ assert . strictEqual ( result . toString ( ) , abc ) ;
4040} ) ) ;
4141
4242// files that have the "right" magic bytes for starting a new gzip member
0 commit comments