智能照明系统APP-本地串口
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.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/ba/ba4353da7ce4b686c6e6fbe3acf...

19 lines
468 B

var test = require('tape');
var vm = require('vm');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8');
test('u8a without globals', function (t) {
var c = {
module: { exports: {} },
};
c.exports = c.module.exports;
vm.runInNewContext(src, c);
var TA = c.module.exports;
var ua = new(TA.Uint8Array)(5);
t.equal(ua.length, 5);
ua[1] = 256 + 55;
t.equal(ua[1], 55);
t.end();
});