mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-19 19:55:11 +00:00
BigInteger: unit test update
This commit is contained in:
parent
34a971d317
commit
92e6b23528
@ -266,7 +266,7 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
|||||||
$this->assertSame('18446744073709551616', (string) $y);
|
$this->assertSame('18446744073709551616', (string) $y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRandom()
|
public function testRandomTwoArgument()
|
||||||
{
|
{
|
||||||
$min = $this->getInstance(0);
|
$min = $this->getInstance(0);
|
||||||
$max = $this->getInstance('18446744073709551616');
|
$max = $this->getInstance('18446744073709551616');
|
||||||
@ -276,11 +276,21 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
|||||||
// chosen it's just not that likely
|
// chosen it's just not that likely
|
||||||
$this->assertTrue($rand1->compare($min) > 0);
|
$this->assertTrue($rand1->compare($min) > 0);
|
||||||
$this->assertTrue($rand1->compare($max) < 0);
|
$this->assertTrue($rand1->compare($max) < 0);
|
||||||
|
}
|
||||||
|
|
||||||
$rand2 = $min->random($max);
|
public function testRandomOneArgument()
|
||||||
|
{
|
||||||
|
$min = $this->getInstance(0);
|
||||||
|
$max = $this->getInstance('18446744073709551616');
|
||||||
|
|
||||||
|
$rand1 = $min->random($max);
|
||||||
$this->assertTrue($rand1->compare($min) > 0);
|
$this->assertTrue($rand1->compare($min) > 0);
|
||||||
$this->assertTrue($rand1->compare($max) < 0);
|
$this->assertTrue($rand1->compare($max) < 0);
|
||||||
|
|
||||||
|
$rand2 = $max->random($min);
|
||||||
|
$this->assertTrue($rand2->compare($min) > 0);
|
||||||
|
$this->assertTrue($rand2->compare($max) < 0);
|
||||||
|
|
||||||
$this->assertFalse($rand1->equals($rand2));
|
$this->assertFalse($rand1->equals($rand2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user