From: Daniel Cousens Date: Thu, 6 Aug 2015 12:11:11 +0000 (+1000) Subject: split ascending/descending copy tests X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=2a7c652fa82909616f20ff198458cea7c60f8f45;p=buffer.git split ascending/descending copy tests --- diff --git a/test/methods.js b/test/methods.js index be92568..f9337e1 100644 --- a/test/methods.js +++ b/test/methods.js @@ -101,11 +101,14 @@ test('copy() after slice()', function (t) { }) test('copy() ascending and descending', function (t) { - var b - b = new B('abcdefghij') + var b = new B('abcdefghij') b.copy(b, 0, 3, 10) // ascending copy t.equal(b.toString(), 'defghijhij') - b = new B('abcdefghij') + t.end() +}) + +test('copy() descending', function (t) { + var b = new B('abcdefghij') b.copy(b, 3, 0, 7) // descending copy t.equal(b.toString(), 'abcabcdefg') t.end()