]> zoso.dev Git - buffer.git/commitdiff
Test buf.constructor is set to Buffer
authorParsha Pourkhomami <parshap+git@gmail.com>
Tue, 7 Jul 2015 19:02:07 +0000 (12:02 -0700)
committerParsha Pourkhomami <parshap+git@gmail.com>
Tue, 7 Jul 2015 19:02:07 +0000 (12:02 -0700)
Currently fails in Safari 5.1. See https://saucelabs.com/beta/tests/c99d86b2a82944539bbb1fe25a8506d3

test/basic.js

index cdaa37d13eab260924514e756067ec1d502b9999..af6d5eef1392255882479492721557d302bfd939 100644 (file)
@@ -2,6 +2,12 @@ var B = require('../').Buffer
 var test = require('tape')
 if (process.env.OBJECT_IMPL) B.TYPED_ARRAY_SUPPORT = false
 
+test('buf.constructor is Buffer', function (t) {
+  var buf = new B([1, 2])
+  t.strictEqual(buf.constructor, B)
+  t.end()
+})
+
 test('convert to Uint8Array in modern browsers', function (t) {
   if (B.TYPED_ARRAY_SUPPORT) {
     var buf = new B([1, 2])