Projekt

Obecné

Profil

Stáhnout (664 Bajtů) Statistiky
| Větev: | Revize:
1
if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false
2
var B = require('../').Buffer
3
var isBuffer = require('is-buffer')
4
var test = require('tape')
5

    
6
test('is-buffer tests', function (t) {
7
  t.ok(isBuffer(new B(4)), 'new Buffer(4)')
8

    
9
  t.notOk(isBuffer(undefined), 'undefined')
10
  t.notOk(isBuffer(null), 'null')
11
  t.notOk(isBuffer(''), 'empty string')
12
  t.notOk(isBuffer(true), 'true')
13
  t.notOk(isBuffer(false), 'false')
14
  t.notOk(isBuffer(0), '0')
15
  t.notOk(isBuffer(1), '1')
16
  t.notOk(isBuffer(1.0), '1.0')
17
  t.notOk(isBuffer('string'), 'string')
18
  t.notOk(isBuffer({}), '{}')
19
  t.notOk(isBuffer(function foo () {}), 'function foo () {}')
20

    
21
  t.end()
22
})
(7-7/13)