Total Complexity | 7 |
Complexity/F | 1 |
Lines of Code | 33 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | |||
2 | var assert = require('assert'); |
||
3 | |||
4 | describe('booleans from bytes', function() { |
||
5 | |||
6 | let byteData = require('../../index.js'); |
||
7 | |||
8 | // booleans |
||
9 | it('should turn 1 boolean bin to 1 number (1)', function() { |
||
10 | assert.deepEqual(byteData.fromBytes(['1'], 1, {"base": 2}), |
||
11 | [1]); |
||
12 | }); |
||
13 | it('should turn 1 boolean hex to 1 number (1)', function() { |
||
14 | assert.deepEqual(byteData.fromBytes([1], 1, {"base": 16}), |
||
15 | [1]); |
||
16 | }); |
||
17 | it('should turn 1 value to 1 booolean decimal (1)', function() { |
||
18 | assert.deepEqual(byteData.fromBytes([1], 1, {"base": 10}), |
||
19 | [1]); |
||
20 | }); |
||
21 | it('should turn 1 value to 1 booolean bin (0)', function() { |
||
22 | assert.deepEqual(byteData.fromBytes(['0'], 1, {"base": 2}), |
||
23 | [0]); |
||
24 | }); |
||
25 | it('should turn 1 value to 1 booolean hex (0)', function() { |
||
26 | assert.deepEqual(byteData.fromBytes(['0'], 1, {"base": 16}), |
||
27 | [0]); |
||
28 | }); |
||
29 | it('should turn 1 value to 1 booolean decimal (0)', function() { |
||
30 | assert.deepEqual(byteData.fromBytes([0], 1, {"base": 10}), |
||
31 | [0]); |
||
32 | }); |
||
33 | |||
34 | }); |
||
35 |