Skip to content

Commit 7cd7a8c

Browse files
authored
tests(library/math): specs preservation of operand identity in greatestCommonDivisor (#571)
- describes [property](https://en.wikipedia.org/wiki/Greatest_common_divisor#Properties) where, for positive integers $$a$$, $$\text{gcd}(a, a) = a$$.
1 parent aa778f5 commit 7cd7a8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/library/math/operator/constructive/greatestCommonDivisor.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ describe(greatestCommonDivisor, () => {
178178
);
179179
});
180180

181-
it.todo('should preserve the identity of matching operands');
181+
it('should preserve the identity of matching operands', () => {
182+
expect.assertions(1);
183+
184+
expect(greatestCommonDivisor(primeA, primeA)).toBe(primeA);
185+
});
182186

183187
it.todo('should return identity factor for co-prime operands');
184188

0 commit comments

Comments
 (0)