Skip to content

Commit

Permalink
fix trim tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenClontz committed Nov 25, 2023
1 parent 766b660 commit ec3dee0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/test/Id.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { format, toInt, trim } from '../src/Id'
import { format, toInt, trim, tag } from '../src/Id'

describe('format', () => {
it('pads the given character', () => {
Expand Down Expand Up @@ -31,18 +31,18 @@ describe('toInt', () => {

describe('trim', () => {
it('trims down to the numeric content', () => {
expect(toInt('T000100')).toEqual(100)
expect(trim('T000100')).toEqual(100)
})

it('does not require leading zeros', () => {
expect(toInt('P12')).toEqual(12)
expect(trim('P12')).toEqual(12)
})

it('does not match nonexistent kinds', () => {
expect(toInt('Z000100')).toEqual(0)
expect(trim('Z000100')).toEqual(0)
})

it('matches unknown kind', () => {
expect(toInt('000123')).toEqual(123)
expect(trim('000123')).toEqual(123)
})
})

0 comments on commit ec3dee0

Please sign in to comment.