1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
amp/test/Pipeline/DiscardTest.php
Niklas Keller 2f778fe069 Use revolt
Removes deprecated APIs.
2021-03-26 22:34:32 +01:00

21 lines
434 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
{
self::assertSame(0, await(Pipeline\discard(Pipeline\fromIterable([]))));
}
public function testCount(): void
{
self::assertSame(3, await(Pipeline\discard(Pipeline\fromIterable(['a', 1, false], 1))));
}
}