Passed
Branch master (9a7ed1)
by Rafael S.
01:20
created

test/from-bytes/booleans.js   A

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 33
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 33
rs 10
wmc 7
mnd 0
bc 7
fnc 7
bpm 1
cpm 1
noi 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