diff options
author | isaacs <i@izs.me> | 2011-09-17 23:03:23 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-09-17 23:03:23 -0700 |
commit | d104bfd5a6d825c58a09e325b7475183d2738849 (patch) | |
tree | 87d5de78c032f40b3a93eb2e416be85ec46e7ce7 /test | |
parent | 5b8e1dabbc117b38c56f874f4e6d5b7e537cd3c1 (diff) | |
download | node-new-d104bfd5a6d825c58a09e325b7475183d2738849.tar.gz |
zlib: Fix test so that it's not trivially passing, then pass it.
Regression from the refactor to move more things into JS.
Diffstat (limited to 'test')
-rw-r--r-- | test/simple/test-zlib.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/simple/test-zlib.js b/test/simple/test-zlib.js index e211d0519f..8b9467f3b9 100644 --- a/test/simple/test-zlib.js +++ b/test/simple/test-zlib.js @@ -59,6 +59,12 @@ if (!process.env.PUMMEL) { var fs = require('fs'); var testFiles = [ 'person.jpg', 'elipses.txt', 'empty.txt' ]; + +if (process.env.FAST) { + zlibPairs = [ [zlib.Gzip, zlib.Unzip] ]; + var testFiles = [ 'person.jpg' ]; +} + var tests = {} testFiles.forEach(function(file) { tests[file] = fs.readFileSync(path.resolve(common.fixturesDir, file)); @@ -81,6 +87,7 @@ util.inherits(BufferStream, stream.Stream); BufferStream.prototype.write = function(c) { this.chunks.push(c); this.length += c.length; + return true; }; BufferStream.prototype.end = function(c) { @@ -94,6 +101,7 @@ BufferStream.prototype.end = function(c) { }); this.emit('data', buf); this.emit('end'); + return true; }; @@ -184,7 +192,7 @@ Object.keys(tests).forEach(function(file) { Def.name + ' -> ' + Inf.name; var ok = true; var testNum = ++done; - for (var i = 0; i < c.length; i++) { + for (var i = 0; i < Math.max(c.length, test.length); i++) { if (c[i] !== test[i]) { ok = false; failures ++; |