Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
564 bytes
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | const tape = require('tape')
|
---|
4 | const { BufferList, BufferListStream } = require('../')
|
---|
5 | const { Buffer } = require('buffer')
|
---|
6 |
|
---|
7 | tape('isBufferList positives', (t) => {
|
---|
8 | t.ok(BufferList.isBufferList(new BufferList()))
|
---|
9 | t.ok(BufferList.isBufferList(new BufferListStream()))
|
---|
10 |
|
---|
11 | t.end()
|
---|
12 | })
|
---|
13 |
|
---|
14 | tape('isBufferList negatives', (t) => {
|
---|
15 | const types = [
|
---|
16 | null,
|
---|
17 | undefined,
|
---|
18 | NaN,
|
---|
19 | true,
|
---|
20 | false,
|
---|
21 | {},
|
---|
22 | [],
|
---|
23 | Buffer.alloc(0),
|
---|
24 | [Buffer.alloc(0)]
|
---|
25 | ]
|
---|
26 |
|
---|
27 | for (const obj of types) {
|
---|
28 | t.notOk(BufferList.isBufferList(obj))
|
---|
29 | }
|
---|
30 |
|
---|
31 | t.end()
|
---|
32 | })
|
---|
Note:
See
TracBrowser
for help on using the repository browser.