Skip to content

Commit ec5a9d7

Browse files
bigmontzrobsdedude
andcommitted
Apply suggestions from code review
Co-authored-by: Robsdedude <dev@rouvenbauer.de>
1 parent 926b432 commit ec5a9d7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

packages/core/test/integer.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,12 @@ describe('Integer', () => {
366366
)
367367
})
368368

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())))
371375
})
372376

373377
test('int(number) should be reversed by Integer.toNumber', () => {
@@ -408,7 +412,7 @@ describe('Integer', () => {
408412
(a, b, c) => a.multiply(b.subtract(c)).equals(a.multiply(b).subtract(a.multiply(c)))))
409413
})
410414

411-
describe('For Same Signal Integers', () => {
415+
describe('with same sign', () => {
412416
test('Integer.greaterThan should return true if a - b is positive', () => {
413417
fc.assert(fc.property(
414418
arbitrarySameSignalIntegers(),
@@ -440,7 +444,7 @@ describe('Integer', () => {
440444
})
441445
})
442446

443-
describe('For Different Signal Integers', () => {
447+
describe('with different sign', () => {
444448
test('Integer.greaterThan should return true if a is positive', () => {
445449
fc.assert(fc.property(
446450
arbitraryDiffSignalIntegers(),
@@ -1309,12 +1313,12 @@ function arbitraryInteger (): fc.Arbitrary<Integer> {
13091313
.map(({ low, high }) => new Integer(low, high))
13101314
}
13111315

1312-
function arbitrarySameSignalIntegers (): fc.Arbitrary<{ a: Integer, b: Integer }> {
1316+
function arbitrarySameSignIntegers (): fc.Arbitrary<{ a: Integer, b: Integer }> {
13131317
return fc.record({ a: arbitraryInteger(), b: arbitraryInteger() })
13141318
.map(({ a, b }) => a.isPositive() === b.isPositive() ? { a, b } : { a, b: b.negate() })
13151319
}
13161320

1317-
function arbitraryDiffSignalIntegers (): fc.Arbitrary<{ a: Integer, b: Integer }> {
1321+
function arbitraryDiffSignIntegers (): fc.Arbitrary<{ a: Integer, b: Integer }> {
13181322
return fc.record({ a: arbitraryInteger(), b: arbitraryInteger() })
13191323
.map(({ a, b }) => a.isPositive() === b.isPositive() ? { a, b: b.negate() } : { a, b })
13201324
}

0 commit comments

Comments
 (0)