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

test/from-bytes/strings.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 22
Function Count 4

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 22
rs 10
wmc 4
mnd 0
bc 4
fnc 4
bpm 1
cpm 1
noi 0
1
2
var assert = require('assert');
3
4
describe('from-bytes', function() {
5
    
6
    let byteData = require('../../index.js');
7
8
    it('should turn bytes to a string', function() {
9
        assert.deepEqual(byteData.fromBytes(
10
            [97, 98], 8, {"base": 10, "char": true}),
11
            "ab");
12
    });
13
    it('should turn hex bytes to a string', function() {
14
        assert.deepEqual(byteData.fromBytes(
15
            ["61", "62"], 8, {"base": 16, "char": true}),
16
            "ab");
17
    });
18
    it('should turn bin bytes to a string', function() {
19
        assert.deepEqual(byteData.fromBytes(
20
            ["01100001", "01100010"], 8, {"base": 2, "char": true}),
21
            "ab");
22
    });
23
});
24