@@ -5,11 +5,11 @@ import { describe, it } from "vitest"
55describe ( "BigIntFromNumber" , ( ) => {
66 const schema = S . BigIntFromNumber
77
8- it . todo ( "test roundtrip consistency" , ( ) => {
8+ it ( "test roundtrip consistency" , ( ) => {
99 Util . assertions . testRoundtripConsistency ( schema )
1010 } )
1111
12- it ( "Decoder " , async ( ) => {
12+ it ( "decoding " , async ( ) => {
1313 await Util . assertions . decoding . succeed ( schema , 0 , 0n )
1414 await Util . assertions . decoding . succeed ( schema , - 0 , - 0n )
1515 await Util . assertions . decoding . succeed ( schema , 1 , 1n )
@@ -44,22 +44,26 @@ describe("BigIntFromNumber", () => {
4444 )
4545 } )
4646
47- it ( "Encoder " , async ( ) => {
47+ it ( "encoding " , async ( ) => {
4848 await Util . assertions . encoding . succeed ( schema , 1n , 1 )
4949
5050 await Util . assertions . encoding . fail (
5151 schema ,
5252 BigInt ( Number . MAX_SAFE_INTEGER ) + 1n ,
5353 `BigIntFromNumber
54- └─ Transformation process failure
55- └─ Unable to encode 9007199254740992n into a number`
54+ └─ Type side transformation failure
55+ └─ betweenBigInt(-9007199254740991, 9007199254740991)
56+ └─ Predicate refinement failure
57+ └─ Expected a bigint between -9007199254740991n and 9007199254740991n, actual 9007199254740992n`
5658 )
5759 await Util . assertions . encoding . fail (
5860 schema ,
5961 BigInt ( Number . MIN_SAFE_INTEGER ) - 1n ,
6062 `BigIntFromNumber
61- └─ Transformation process failure
62- └─ Unable to encode -9007199254740992n into a number`
63+ └─ Type side transformation failure
64+ └─ betweenBigInt(-9007199254740991, 9007199254740991)
65+ └─ Predicate refinement failure
66+ └─ Expected a bigint between -9007199254740991n and 9007199254740991n, actual -9007199254740992n`
6367 )
6468 } )
6569} )
0 commit comments