1 | var tap = require('tap')
|
2 | var test = tap.test
|
3 | var same = require('../')
|
4 |
|
5 |
|
6 | delete same.fastEqual
|
7 |
|
8 | test('should match empty Buffers', function (t) {
|
9 | t.ok(same(new Buffer([]), new Buffer([])))
|
10 | t.end()
|
11 | })
|
12 |
|
13 | test('should match similar Buffers', function (t) {
|
14 | t.ok(same(
|
15 | new Buffer([0]),
|
16 | new Buffer([0])
|
17 | ))
|
18 | t.ok(same(
|
19 | new Buffer([0, 1, 3]),
|
20 | new Buffer([0, 1, 3])
|
21 | ))
|
22 | t.end()
|
23 | })
|
24 |
|
25 | test('should notice different Buffers', function (t) {
|
26 | t.notOk(same(
|
27 | new Buffer([0, 1, 2]),
|
28 | new Buffer([0, 1, 23])
|
29 | ))
|
30 | t.notOk(same(
|
31 | new Buffer([0, 1]),
|
32 | new Buffer([0, 1, 23])
|
33 | ))
|
34 | t.end()
|
35 | })
|