Skip to content

Commit e1d827e

Browse files
committed
test: Hex bijectivity
1 parent 1874b0e commit e1d827e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/nuqs/src/parsers.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ describe('parsers', () => {
7676
expect(parseAsHex.parse('1')).toBe(1)
7777
expect(parseAsHex.parse('a')).toBe(0xa)
7878
expect(parseAsHex.parse('g')).toBeNull()
79-
expect(parseAsHex.serialize(0xa)).toBe('0a')
79+
expect(parseAsHex.serialize(0x0a)).toBe('0a')
80+
expect(parseAsHex.serialize(0x2a)).toBe('2a')
81+
testParseThenSerialize(parseAsHex, '2a')
82+
testSerializeThenParse(parseAsHex, 0x2a)
8083
})
8184
test('parseAsBoolean', () => {
8285
expect(parseAsBoolean.parse('')).toBe(false)

0 commit comments

Comments
 (0)