1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
amp/test/Iterator/DiscardTest.php

21 lines
439 B
PHP
Raw Normal View History

2020-05-06 18:57:29 +02:00
<?php
2020-05-13 17:15:21 +02:00
namespace Amp\Test\Iterator;
2020-05-06 18:57:29 +02:00
use Amp\Iterator;
use Amp\PHPUnit\AsyncTestCase;
use function Amp\Iterator\discard;
2020-05-13 17:15:21 +02:00
class DiscardTest extends AsyncTestCase
2020-05-06 18:57:29 +02:00
{
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)));
}
}