summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-09-17 23:03:23 -0700
committerisaacs <i@izs.me>2011-09-17 23:03:23 -0700
commitd104bfd5a6d825c58a09e325b7475183d2738849 (patch)
tree87d5de78c032f40b3a93eb2e416be85ec46e7ce7 /test
parent5b8e1dabbc117b38c56f874f4e6d5b7e537cd3c1 (diff)
downloadnode-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.js10
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 ++;