Skip to content

Commit

Permalink
Test loading uuid7 from buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Dec 19, 2024
1 parent 3c459e4 commit 817dee4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin-server/tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ describe('utils', () => {
const uuid7 = new UUID7(timestamp, randomBytes)
expect(uuid7.toString()).toEqual('0192df64-df98-7123-8567-89abcdef0123')
})
it('can be loaded from a buffer', () => {
const str = '0192df64df987123856789abcdef0123'
const uuid = new UUID7(new Buffer(str, 'hex'))
expect(uuid.toString().replace(/-/g, '')).toEqual(str)
})
})

describe('sanitizeSqlIdentifier', () => {
Expand Down

0 comments on commit 817dee4

Please sign in to comment.