Page MenuHomeWickedGov Phorge

SequenceTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

SequenceTest.php

<?php
use Eris\Generators;
class SequenceTest extends \PHPUnit\Framework\TestCase
{
use Eris\TestTrait;
public function testArrayReversePreserveLength()
{
$this
->forAll(
Generators::seq(Generators::nat())
)
->then(function ($array) {
self::assertCount(count($array), array_reverse($array));
});
}
public function testArrayReverse()
{
$this
->forAll(
Generators::seq(Generators::nat())
)
->then(function ($array) {
$this->assertEquals($array, array_reverse(array_reverse($array)));
});
}
public function testArraySortingIsIdempotent()
{
$this
->forAll(
Generators::seq(Generators::nat())
)
->then(function ($array) {
sort($array);
$expected = $array;
sort($array);
$this->assertEquals($expected, $array);
});
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 14 2026, 04:53 (14 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
32/2d/8af5b5db57d37584a3763e738939
Default Alt Text
SequenceTest.php (1 KB)

Event Timeline