From: Devon Govett Date: Thu, 10 Apr 2014 07:02:47 +0000 (-0700) Subject: Use correct Buffer in tests X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=9b30c54d52e424d4435ec5ba4c7e4f74bb140aec;p=buffer.git Use correct Buffer in tests `new B` instead of `new Buffer`, otherwise browserify will inline the old version in the tests and we won't be testing anything. :) --- diff --git a/test/slice.js b/test/slice.js index 6a5914f..4efbe30 100644 --- a/test/slice.js +++ b/test/slice.js @@ -4,7 +4,7 @@ var test = require('tape') test('modifying buffer created by .slice() modifies original memory', function (t) { if (!B._useTypedArrays) return t.end() - var buf1 = new Buffer(26) + var buf1 = new B(26) for (var i = 0 ; i < 26 ; i++) { buf1[i] = i + 97 // 97 is ASCII a } @@ -21,7 +21,7 @@ test('modifying buffer created by .slice() modifies original memory', function ( test('modifying parent buffer modifies .slice() buffer\'s memory', function (t) { if (!B._useTypedArrays) return t.end() - var buf1 = new Buffer(26) + var buf1 = new B(26) for (var i = 0 ; i < 26 ; i++) { buf1[i] = i + 97 // 97 is ASCII a }