@@ -366,8 +366,12 @@ describe('Integer', () => {
366
366
)
367
367
} )
368
368
369
- test ( 'int(string) should be reversed by Integer.toString' , ( ) => {
370
- fc . assert ( fc . property ( fc . integer ( ) . map ( num => num . toString ( ) ) , str => str === int ( str ) . toString ( ) ) )
369
+ test ( 'int.toString() should match Integer.toString()' , ( ) => {
370
+ fc . assert ( fc . property ( fc . integer ( ) , i => i . toString ( ) === int ( i ) . toString ( ) ) )
371
+ } )
372
+
373
+ test ( 'int(string) should match int(Integer)' , ( ) => {
374
+ fc . assert ( fc . property ( fc . integer ( ) , i => int ( i ) === int ( i . toString ( ) ) ) )
371
375
} )
372
376
373
377
test ( 'int(number) should be reversed by Integer.toNumber' , ( ) => {
@@ -408,7 +412,7 @@ describe('Integer', () => {
408
412
( a , b , c ) => a . multiply ( b . subtract ( c ) ) . equals ( a . multiply ( b ) . subtract ( a . multiply ( c ) ) ) ) )
409
413
} )
410
414
411
- describe ( 'For Same Signal Integers ' , ( ) => {
415
+ describe ( 'with same sign ' , ( ) => {
412
416
test ( 'Integer.greaterThan should return true if a - b is positive' , ( ) => {
413
417
fc . assert ( fc . property (
414
418
arbitrarySameSignalIntegers ( ) ,
@@ -440,7 +444,7 @@ describe('Integer', () => {
440
444
} )
441
445
} )
442
446
443
- describe ( 'For Different Signal Integers ' , ( ) => {
447
+ describe ( 'with different sign ' , ( ) => {
444
448
test ( 'Integer.greaterThan should return true if a is positive' , ( ) => {
445
449
fc . assert ( fc . property (
446
450
arbitraryDiffSignalIntegers ( ) ,
@@ -1309,12 +1313,12 @@ function arbitraryInteger (): fc.Arbitrary<Integer> {
1309
1313
. map ( ( { low, high } ) => new Integer ( low , high ) )
1310
1314
}
1311
1315
1312
- function arbitrarySameSignalIntegers ( ) : fc . Arbitrary < { a : Integer , b : Integer } > {
1316
+ function arbitrarySameSignIntegers ( ) : fc . Arbitrary < { a : Integer , b : Integer } > {
1313
1317
return fc . record ( { a : arbitraryInteger ( ) , b : arbitraryInteger ( ) } )
1314
1318
. map ( ( { a, b } ) => a . isPositive ( ) === b . isPositive ( ) ? { a, b } : { a, b : b . negate ( ) } )
1315
1319
}
1316
1320
1317
- function arbitraryDiffSignalIntegers ( ) : fc . Arbitrary < { a : Integer , b : Integer } > {
1321
+ function arbitraryDiffSignIntegers ( ) : fc . Arbitrary < { a : Integer , b : Integer } > {
1318
1322
return fc . record ( { a : arbitraryInteger ( ) , b : arbitraryInteger ( ) } )
1319
1323
. map ( ( { a, b } ) => a . isPositive ( ) === b . isPositive ( ) ? { a, b : b . negate ( ) } : { a, b } )
1320
1324
}
0 commit comments