From d0a98ce1297d27af2959a26bbf965a898dab5634 Mon Sep 17 00:00:00 2001 From: brianc Date: Fri, 8 Oct 2010 23:15:47 -0500 Subject: [PATCH] moved equalBuffers to test-helper --- test/test-helper.js | 15 +++++++++++++++ test/writer-tests.js | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/test-helper.js b/test/test-helper.js index 1efb1d8..62cb0c7 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -11,6 +11,21 @@ assert.same = function(actual, expected) { } }; +assert.equalBuffers = function(actual, expected) { + if(actual.length != expected.length) { + console.log(actual); + console.log(expected); + assert.equal(actual.length, expected.length); + } + for(var i = 0; i < actual.length; i++) { + if(actual[i] != expected[i]) { + console.log(actual); + console.log(expected); + } + assert.equal(actual[i],expected[i]); + } +}; + assert.empty = function(actual) { assert.length(actual, 0); }; diff --git a/test/writer-tests.js b/test/writer-tests.js index e69aeb4..a469ecc 100644 --- a/test/writer-tests.js +++ b/test/writer-tests.js @@ -1,21 +1,6 @@ require(__dirname + "/test-helper"); -assert.equalBuffers = function(actual, expected) { - if(actual.length != expected.length) { - console.log(actual); - console.log(expected); - assert.equal(actual.length, expected.length); - } - for(var i = 0; i < actual.length; i++) { - if(actual[i] != expected[i]) { - console.log(actual); - console.log(expected); - } - assert.equal(actual[i],expected[i]); - } -} - BufferList.prototype.compare = function(expected) { var buf = this.join(); assert.equalBuffers(buf, expected);