]> zoso.dev Git - buffer.git/commitdiff
Merge branch 'master' of github.com:devongovett/buffer into devongovett-master
authorFeross Aboukhadijeh <feross@feross.org>
Tue, 8 Apr 2014 07:54:22 +0000 (00:54 -0700)
committerFeross Aboukhadijeh <feross@feross.org>
Tue, 8 Apr 2014 07:54:22 +0000 (00:54 -0700)
1  2 
index.js
test/buffer.js

diff --cc index.js
Simple merge
diff --cc test/buffer.js
index 076b3be2395eb2c8a93d1a8cede8efd7b06a2475,a7bb69026fb9302bb002b7c03df6c6dec98884cc..9fdfea1e1838545bd89210ddd6019641d5112391
@@@ -233,9 -253,25 +233,25 @@@ test('copy() empty buffer with sourceEn
    t.end()
  })
  
+ test('copy() after slice()', function(t) {
+   t.plan(1)
+   var source = new B(200)
+   var dest = new B(200)
+   var expected = new B(200)
+   for (var i = 0; i < 200; i++) {
+     source[i] = i
+     dest[i] = 0
+   }
+   
+   source.slice(2).copy(dest)
+   source.copy(expected, 0, 2)
+   t.deepEqual(dest, expected)
+   t.end()
+ })
  test('base64 ignore whitespace', function(t) {
    t.plan(1)
 -  var text = "\n   YW9ldQ==  "
 +  var text = '\n   YW9ldQ==  '
    var buf = new B(text, 'base64')
    t.equal(buf.toString(), 'aoeu')
    t.end()