1
0
mirror of https://github.com/danog/amp.git synced 2024-12-04 10:28:01 +01:00
amp/test/IteratorDiscardTest.php

21 lines
438 B
PHP
Raw Normal View History

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