mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
353 B
17 lines
353 B
8 years ago
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
const assert = require('assert');
|
||
|
|
||
|
const b = Buffer.from('abcdf');
|
||
|
const c = Buffer.from('abcdf');
|
||
|
const d = Buffer.from('abcde');
|
||
|
const e = Buffer.from('abcdef');
|
||
|
|
||
|
assert.ok(b.equals(c));
|
||
|
assert.ok(!c.equals(d));
|
||
|
assert.ok(!d.equals(e));
|
||
|
assert.ok(d.equals(d));
|
||
|
|
||
|
assert.throws(() => Buffer.alloc(1).equals('abc'));
|