コード例 #1
0
ファイル: FPTest.php プロジェクト: steos/php-quickcheck
 function testPartition()
 {
     $this->assertEquals([[0], [1], [2]], FP::realize(FP::partition(1, FP::range(0, 3))));
     $this->assertEquals([[0, 1], [2, 3], [4, 5], [6]], FP::realize(FP::partition(2, FP::range(0, 7))));
     $this->assertEquals([[0, 1, 2], [3, 4, 5], [6, 7]], FP::realize(FP::partition(3, FP::range(0, 8))));
 }
コード例 #2
0
ファイル: Generator.php プロジェクト: steos/php-quickcheck
 public static function sizes($maxSize)
 {
     return FP::cycle(function () use($maxSize) {
         return FP::range(0, $maxSize);
     });
 }