1
0
mirror of https://github.com/danog/amp.git synced 2024-12-04 02:17:54 +01:00
amp/test/Pipeline/DiscardTest.php

20 lines
412 B
PHP
Raw Normal View History

2020-08-23 16:18:28 +02:00
<?php
namespace Amp\Test\Pipeline;
use Amp\PHPUnit\AsyncTestCase;
use Amp\Pipeline;
class DiscardTest extends AsyncTestCase
{
2020-09-28 05:19:52 +02:00
public function testEmpty(): void
2020-08-23 16:18:28 +02:00
{
2021-04-04 20:10:23 +02:00
self::assertSame(0, Pipeline\discard(Pipeline\fromIterable([]))->join());
2020-08-23 16:18:28 +02:00
}
2020-09-28 05:19:52 +02:00
public function testCount(): void
2020-08-23 16:18:28 +02:00
{
2021-04-04 20:10:23 +02:00
self::assertSame(3, Pipeline\discard(Pipeline\fromIterable(['a', 1, false], 1))->join());
2020-08-23 16:18:28 +02:00
}
}