@@ -7,26 +7,27 @@ const zlib = require('zlib');
7
7
const fs = require ( 'fs' ) ;
8
8
const fixtures = require ( '../common/fixtures' ) ;
9
9
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 ) ;
12
15
13
16
const data = Buffer . concat ( [
14
17
abcEncoded ,
15
18
defEncoded
16
19
] ) ;
17
20
18
- assert . strictEqual ( zlib . gunzipSync ( data ) . toString ( ) , 'abcdef' ) ;
21
+ assert . strictEqual ( zlib . gunzipSync ( data ) . toString ( ) , ( abc + def ) ) ;
19
22
20
23
zlib . gunzip ( data , common . mustCall ( ( err , result ) => {
21
24
assert . ifError ( err ) ;
22
- assert . strictEqual ( result . toString ( ) , 'abcdef' ,
23
- 'result should match original string' ) ;
25
+ assert . strictEqual ( result . toString ( ) , ( abc + def ) ) ;
24
26
} ) ) ;
25
27
26
28
zlib . unzip ( data , common . mustCall ( ( err , result ) => {
27
29
assert . ifError ( err ) ;
28
- assert . strictEqual ( result . toString ( ) , 'abcdef' ,
29
- 'result should match original string' ) ;
30
+ assert . strictEqual ( result . toString ( ) , ( abc + def ) ) ;
30
31
} ) ) ;
31
32
32
33
// Multi-member support does not apply to zlib inflate/deflate.
@@ -35,8 +36,7 @@ zlib.unzip(Buffer.concat([
35
36
zlib . deflateSync ( 'def' )
36
37
] ) , common . mustCall ( ( err , result ) => {
37
38
assert . ifError ( err ) ;
38
- assert . strictEqual ( result . toString ( ) , 'abc' ,
39
- 'result should match contents of first "member"' ) ;
39
+ assert . strictEqual ( result . toString ( ) , abc ) ;
40
40
} ) ) ;
41
41
42
42
// files that have the "right" magic bytes for starting a new gzip member
0 commit comments