Skip to content

Commit 581d940

Browse files
committed
updates
1 parent da560ac commit 581d940

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

test/parsebox/runtime/bigint.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Runtime } from '@sinclair/parsebox'
2+
import { Assert } from 'test'
3+
4+
const Test = Assert.Context('Runtime.Parse.BigInt')
5+
6+
Test('Should BigInt 1', () => Assert.IsEqual(Runtime.Parse(Runtime.BigInt(), '0n'), ['0', '']))
7+
Test('Should BigInt 2', () => Assert.IsEqual(Runtime.Parse(Runtime.BigInt(), '00n'), []))
8+
Test('Should BigInt 3', () => Assert.IsEqual(Runtime.Parse(Runtime.BigInt(), '10n'), ['10', '']))
9+
Test('Should BigInt 4', () => Assert.IsEqual(Runtime.Parse(Runtime.BigInt(), ' 0n'), ['0', '']))
10+
Test('Should BigInt 5', () => Assert.IsEqual(Runtime.Parse(Runtime.BigInt(), '0n '), ['0', ' ']))

test/parsebox/runtime/integer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Runtime } from '@sinclair/parsebox'
2+
import { Assert } from 'test'
3+
4+
const Test = Assert.Context('Runtime.Parse.Integer')
5+
6+
Test('Should Integer 1', () => Assert.IsEqual(Runtime.Parse(Runtime.Integer(), '0'), ['0', '']))
7+
Test('Should Integer 2', () => Assert.IsEqual(Runtime.Parse(Runtime.Integer(), '00'), ['0', '0']))
8+
Test('Should Integer 3', () => Assert.IsEqual(Runtime.Parse(Runtime.Integer(), '10'), ['10', '']))
9+
Test('Should Integer 4', () => Assert.IsEqual(Runtime.Parse(Runtime.Integer(), ' 0'), ['0', '']))

test/parsebox/static/bigint.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
// deno-fmt-ignore-file
22

33
import { Static } from '@sinclair/parsebox'
4-
function Assert<Left, _Right extends Left>(): void {}
4+
function Assert<Left, _Right extends Left>(): void {}
5+
6+
Assert<Static.Parse<Static.BigInt, '0n'>, ['0', '']>()
7+
Assert<Static.Parse<Static.BigInt, '00n'>, []>()
8+
Assert<Static.Parse<Static.BigInt, '10n'>, ['10', '']>()
9+
Assert<Static.Parse<Static.BigInt, ' 0n'>, ['0', '']>()
10+
Assert<Static.Parse<Static.BigInt, '0n '>, ['0', ' ']>()
11+

test/parsebox/static/integer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// deno-fmt-ignore-file
22

33
import { Static } from '@sinclair/parsebox'
4-
function Assert<Left, _Right extends Left>(): void {}
4+
function Assert<Left, _Right extends Left>(): void {}
5+
6+
Assert<Static.Parse<Static.Integer, '0'>, ['0', '']>()
7+
Assert<Static.Parse<Static.Integer, '00'>, ['0', '0']>()
8+
Assert<Static.Parse<Static.Integer, '10'>, ['10', '']>()
9+
Assert<Static.Parse<Static.Integer, ' 0'>, ['0', '']>()

0 commit comments

Comments
 (0)