1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 18:07:57 +01:00
amp/test/Pipeline/DiscardTest.php
2020-10-02 13:40:29 -05:00

21 lines
436 B
PHP

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