diff options
author | Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com> | 2015-02-06 18:54:29 +0300 |
---|---|---|
committer | micnic <micnic90@gmail.com> | 2015-02-07 01:08:40 +0300 |
commit | 1cd1d7a182c2d16c28c778ddcd72bbeac6bc5c75 (patch) | |
tree | 647f9b44233c08248d6414d3d82dbb122fd98084 /test | |
parent | 847b9d212a404e5906ea9f366c458332c0318c53 (diff) |
buffer: don't compare same buffers
PR-URL: https://github.com/iojs/io.js/pull/742
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-buffer.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/parallel/test-buffer.js b/test/parallel/test-buffer.js index 3c25b8e3c3f..1c2c4250900 100644 --- a/test/parallel/test-buffer.js +++ b/test/parallel/test-buffer.js @@ -1128,11 +1128,14 @@ assert.equal(b.compare(c), -1); assert.equal(c.compare(d), 1); assert.equal(d.compare(b), 1); assert.equal(b.compare(d), -1); +assert.equal(b.compare(b), 0); assert.equal(Buffer.compare(b, c), -1); assert.equal(Buffer.compare(c, d), 1); assert.equal(Buffer.compare(d, b), 1); assert.equal(Buffer.compare(b, d), -1); +assert.equal(Buffer.compare(c, c), 0); + assert.throws(function() { var b = new Buffer(1); @@ -1158,6 +1161,7 @@ var e = new Buffer(6).fill('abcdef'); assert.ok(b.equals(c)); assert.ok(!c.equals(d)); assert.ok(!d.equals(e)); +assert.ok(d.equals(d)); assert.throws(function() { var b = new Buffer(1); |