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.
24 lines
572 B
24 lines
572 B
4 weeks ago
|
'use strict'
|
||
|
|
||
|
const test = require('tape')
|
||
|
const {
|
||
|
stringArrayToHexStripped
|
||
|
} = require('../lib/utils')
|
||
|
|
||
|
test('stringArrayToHexStripped', (t) => {
|
||
|
const testCases = [
|
||
|
[[['0', '0', '0', '0']], ''],
|
||
|
[[['0', '0', '0', '0'], false], ''],
|
||
|
[[['0', '0', '0', '0'], true], '0'],
|
||
|
[[['0', '1', '0', '0'], false], '100'],
|
||
|
[[['1', '0', '0', '0'], false], '1000'],
|
||
|
[[['1', '0', '0', '0'], true], '1000']
|
||
|
]
|
||
|
|
||
|
t.plan(testCases.length)
|
||
|
|
||
|
testCases.forEach(([input, expected]) => {
|
||
|
t.same(stringArrayToHexStripped(input[0], input[1]), expected)
|
||
|
})
|
||
|
})
|