1 |
3a515b92
|
cagy
|
if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false
|
2 |
|
|
var B = require('../').Buffer
|
3 |
|
|
var test = require('tape')
|
4 |
|
|
|
5 |
|
|
test('Buffer.isEncoding', function (t) {
|
6 |
|
|
t.equal(B.isEncoding('HEX'), true)
|
7 |
|
|
t.equal(B.isEncoding('hex'), true)
|
8 |
|
|
t.equal(B.isEncoding('bad'), false)
|
9 |
|
|
t.end()
|
10 |
|
|
})
|
11 |
|
|
|
12 |
|
|
test('Buffer.isBuffer', function (t) {
|
13 |
|
|
t.equal(B.isBuffer(new B('hey', 'utf8')), true)
|
14 |
|
|
t.equal(B.isBuffer(new B([1, 2, 3], 'utf8')), true)
|
15 |
|
|
t.equal(B.isBuffer('hey'), false)
|
16 |
|
|
t.end()
|
17 |
|
|
})
|