Skip to content

Commit

Permalink
Issue #10: Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed May 29, 2018
1 parent 318097b commit d9794f3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/src/Iterators/CombinationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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());
}
}

0 comments on commit d9794f3

Please sign in to comment.