@@ -393,17 +393,17 @@ public function testTen(): void
393393 }
394394
395395 #[DataProvider('providerGcdAll ' )]
396- public function testGcdAll (array $ values , string $ expectedGCD ): void
396+ public function testGcdAll (array $ values , string | int $ expectedGCD ): void
397397 {
398- self ::assertSame ( $ expectedGCD , (string ) BigInteger::gcdAll (...$ values ));
399- self ::assertSame ( $ expectedGCD , (string ) BigInteger::gcdMultiple (...$ values ));
398+ self ::assertBigIntegerEquals ( (string ) $ expectedGCD , BigInteger::gcdAll (...$ values ));
399+ self ::assertBigIntegerEquals ( (string ) $ expectedGCD , BigInteger::gcdMultiple (...$ values ));
400400 }
401401
402402 public static function providerGcdAll (): Generator
403403 {
404404 // 1 value
405- foreach ([' -2 ' , ' -1 ' , ' 0 ' , ' 1 ' , ' 2 ' ] as $ value ) {
406- yield [[$ value ], $ value ];
405+ foreach ([- 4 , - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 , 4 ] as $ value ) {
406+ yield [[$ value ], abs ( $ value) ];
407407 }
408408
409409 // 2 values
@@ -417,6 +417,9 @@ public static function providerGcdAll(): Generator
417417 yield [['2 ' , '4 ' , '-7 ' ], '1 ' ];
418418 yield [['2 ' , '4 ' , '-8 ' ], '2 ' ];
419419 yield [['28 ' , '56 ' , '77777 ' ], '7 ' ];
420+ yield [['-28 ' , '56 ' , '77777 ' ], '7 ' ];
421+ yield [['-28 ' , '-56 ' , '77777 ' ], '7 ' ];
422+ yield [['-28 ' , '-56 ' , '-77777 ' ], '7 ' ];
420423 yield [['28 ' , '56 ' , '77778 ' ], '2 ' ];
421424 yield [['28 ' , '56 ' , '77782 ' ], '2 ' ];
422425 yield [['28 ' , '56 ' , '77783 ' ], '1 ' ];
0 commit comments