[79a0317] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | const test = require('tape')
|
---|
| 4 | const {
|
---|
| 5 | stringArrayToHexStripped
|
---|
| 6 | } = require('../lib/utils')
|
---|
| 7 |
|
---|
| 8 | test('stringArrayToHexStripped', (t) => {
|
---|
| 9 | const testCases = [
|
---|
| 10 | [[['0', '0', '0', '0']], ''],
|
---|
| 11 | [[['0', '0', '0', '0'], false], ''],
|
---|
| 12 | [[['0', '0', '0', '0'], true], '0'],
|
---|
| 13 | [[['0', '1', '0', '0'], false], '100'],
|
---|
| 14 | [[['1', '0', '0', '0'], false], '1000'],
|
---|
| 15 | [[['1', '0', '0', '0'], true], '1000']
|
---|
| 16 | ]
|
---|
| 17 |
|
---|
| 18 | t.plan(testCases.length)
|
---|
| 19 |
|
---|
| 20 | testCases.forEach(([input, expected]) => {
|
---|
| 21 | t.same(stringArrayToHexStripped(input[0], input[1]), expected)
|
---|
| 22 | })
|
---|
| 23 | })
|
---|