From d9794f3218acdd24826b7572f95abad560d4e422 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 29 May 2018 09:35:27 +0200 Subject: [PATCH] Issue #10: Add tests. --- tests/src/Iterators/CombinationsTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/src/Iterators/CombinationsTest.php b/tests/src/Iterators/CombinationsTest.php index 3356929..ce695e2 100644 --- a/tests/src/Iterators/CombinationsTest.php +++ b/tests/src/Iterators/CombinationsTest.php @@ -29,7 +29,8 @@ public function testCombinations($input, $expected) $this->assertEquals($input['dataset'], $combinations->getDataset()); $this->assertEquals($input['length'], $combinations->getLength()); - $this->assertEquals(count($input['dataset']), count($combinations->getDataset())); + $this->assertCount(count($input['dataset']), + $combinations->getDataset()); $this->assertEquals( $expected['dataset'], $combinations->toArray(), @@ -40,4 +41,15 @@ public function testCombinations($input, $expected) ); $this->assertEquals($expected['count'], $combinations->count()); } + + /** + * Test combinations with big numbers. + * + * @see https://github.com/drupol/phpermutations/issues/10 + */ + public function testCombinationsWithBigNumbers() + { + $combinations = new Combinations(range(1, 200), 2); + $this->assertCount($combinations->count(), $combinations->toArray()); + } }