1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
amp/test/Pipeline/DiscardTest.php
2020-09-24 12:53:31 -05:00

20 lines
422 B
PHP

<?php
namespace Amp\Test\Pipeline;
use Amp\PHPUnit\AsyncTestCase;
use Amp\Pipeline;
class DiscardTest extends AsyncTestCase
{
public function testEmpty(): \Generator
{
$this->assertSame(0, yield Pipeline\discard(Pipeline\fromIterable([])));
}
public function testCount(): \Generator
{
$this->assertSame(3, yield Pipeline\discard(Pipeline\fromIterable(['a', 1, false], 1)));
}
}