-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"timeout": 5, | ||
"source": { | ||
"directories": [ | ||
"lib" | ||
] | ||
}, | ||
"logs": { | ||
"text": "infection.log" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
|
||
namespace Amp\ByteStream\Test; | ||
|
||
use Amp\ByteStream\PendingReadError; | ||
use Amp\PHPUnit\TestCase; | ||
|
||
class PendingReadErrorTest extends TestCase | ||
{ | ||
|
||
public function testDefaultErrorCode() | ||
{ | ||
$this->assertSame(0, (new PendingReadError)->getCode()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
|
||
namespace Amp\ByteStream\Test; | ||
|
||
use Amp\ByteStream\IteratorStream; | ||
use Amp\ByteStream\OutputBuffer; | ||
use Amp\Iterator; | ||
use Amp\PHPUnit\TestCase; | ||
use function Amp\ByteStream\pipe; | ||
use function Amp\Promise\wait; | ||
|
||
class PipeTest extends TestCase | ||
{ | ||
public function testPipe() | ||
{ | ||
$stream = new IteratorStream(Iterator\fromIterable(["abc", "def"])); | ||
$buffer = new OutputBuffer; | ||
|
||
$this->assertSame(6, wait(pipe($stream, $buffer))); | ||
|
||
$buffer->end(); | ||
$this->assertSame("abcdef", wait($buffer)); | ||
} | ||
} |