You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
382 B
JavaScript
18 lines
382 B
JavaScript
6 years ago
|
|
||
|
var assert = require('assert')
|
||
|
var ref = require('../')
|
||
|
|
||
|
describe('char', function () {
|
||
|
|
||
|
it('should accept a JS String, and write the first char\'s code', function () {
|
||
|
var val = 'a'
|
||
|
|
||
|
var buf = ref.alloc('char', val)
|
||
|
assert.strictEqual(val.charCodeAt(0), buf.deref())
|
||
|
|
||
|
buf = ref.alloc('uchar', val)
|
||
|
assert.strictEqual(val.charCodeAt(0), buf.deref())
|
||
|
})
|
||
|
|
||
|
})
|