PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
binary
/
test
var binary = require('../'); var test = require('tap').test; test('lu', function (t) { t.plan(8); // note: can't store -12667700813876161 exactly in an ieee float var buf = new Buffer([ 44, // a == 44 43, 2, // b == 555 37, 37, 213, 164, // c == 2765432101 193, 203, 115, 155, 20, 180, 81, 29, // d == 2112667700813876161 ]); binary.parse(buf) .word8lu('a') .word16lu('b') .word32lu('c') .word64lu('d') .tap(function (vars) { t.same(vars.a, 44); t.same(vars.b, 555); t.same(vars.c, 2765432101); t.ok( Math.abs(vars.d - 2112667700813876161) < 1500 ); }) ; // also check aliases here: binary.parse(buf) .word8le('a') .word16le('b') .word32le('c') .word64le('d') .tap(function (vars) { t.same(vars.a, 44); t.same(vars.b, 555); t.same(vars.c, 2765432101); t.ok( Math.abs(vars.d - 2112667700813876161) < 1500 ); }) ; });
[-] loop.js
[edit]
[-] peek.js
[edit]
[-] immediate.js
[edit]
[-] posbs.js
[edit]
[-] dots.js
[edit]
[-] negls.js
[edit]
[-] not_enough_buf.js
[edit]
[-] scan.js
[edit]
[+]
..
[-] split.js
[edit]
[-] posls.js
[edit]
[-] loop_scan.js
[edit]
[-] deferred.js
[edit]
[-] negbs.js
[edit]
[-] interval.js
[edit]
[-] skip.js
[edit]
[-] not_enough_parse.js
[edit]
[-] into_stream.js
[edit]
[-] parse.js
[edit]
[-] pipe.js
[edit]
[-] bu.js
[edit]
[-] lu.js
[edit]
[-] scan_buf_null.js
[edit]
[-] nested.js
[edit]
[-] flush.js
[edit]
[-] from_buffer.js
[edit]
[-] eof.js
[edit]
[-] get_buffer.js
[edit]
[-] into_buffer.js
[edit]
[-] scan_buf.js
[edit]