mirror of
https://github.com/danog/amp.git
synced 2024-12-02 17:37:50 +01:00
21 lines
438 B
PHP
21 lines
438 B
PHP
<?php
|
|
|
|
namespace Amp\Test;
|
|
|
|
use Amp\Iterator;
|
|
use Amp\PHPUnit\AsyncTestCase;
|
|
use function Amp\Iterator\discard;
|
|
|
|
class IteratorDiscardTest extends AsyncTestCase
|
|
{
|
|
public function testEmpty(): \Generator
|
|
{
|
|
$this->assertSame(0, yield discard(Iterator\fromIterable([])));
|
|
}
|
|
|
|
public function testCount(): \Generator
|
|
{
|
|
$this->assertSame(3, yield discard(Iterator\fromIterable(['a', 1, false], 1)));
|
|
}
|
|
}
|