2020-08-24 17:16:35 +09:00
|
|
|
import test from 'ava'
|
2020-06-21 20:10:06 +09:00
|
|
|
|
|
|
|
const bindings = require('../index.node')
|
|
|
|
|
|
|
|
test('should get buffer length', (t) => {
|
|
|
|
const fixture = Buffer.from('wow, hello')
|
|
|
|
t.is(bindings.getBufferLength(fixture), fixture.length)
|
|
|
|
})
|
|
|
|
|
|
|
|
test('should stringify buffer', (t) => {
|
|
|
|
const fixture = 'wow, hello'
|
|
|
|
t.is(bindings.bufferToString(Buffer.from(fixture)), fixture)
|
|
|
|
})
|