gameStatusUpdate/node_modules/fast-uri/test/util.test.js

24 lines
572 B
JavaScript
Raw Normal View History

2024-09-18 08:27:46 -07:00
'use strict'
2024-11-04 11:06:36 -08:00
const test = require('tape')
2024-09-18 08:27:46 -07:00
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]) => {
2024-11-04 11:06:36 -08:00
t.same(stringArrayToHexStripped(input[0], input[1]), expected)
2024-09-18 08:27:46 -07:00
})
})