basant307/AI_Governance_Project
048
1'use strict'2 3const test = require('tape')4const {5 stringArrayToHexStripped,6 removeDotSegments7} = require('../lib/utils')8 9test('stringArrayToHexStripped', (t) => {10 const testCases = [11 [['0', '0', '0', '0'], ''],12 [['0', '0', '0', '1'], '1'],13 [['0', '0', '1', '0'], '10'],14 [['0', '1', '0', '0'], '100'],15 [['1', '0', '0', '0'], '1000'],16 [['1', '0', '0', '1'], '1001'],17 ]18 19 t.plan(testCases.length)20 21 testCases.forEach(([input, expected]) => {22 t.same(stringArrayToHexStripped(input), expected)23 })24})25 26// Just fixtures, because this function already tested by resolve27test('removeDotSegments', (t) => {28 const testCases = []29 // https://github.com/fastify/fast-uri/issues/13930 testCases.push(['WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a',31 'WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a'])32 33 t.plan(testCases.length)34 35 testCases.forEach(([input, expected]) => {36 t.same(removeDotSegments(input), expected)37 })38})39 