diff --git a/composer.json b/composer.json index b06ee53..e08c38f 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": ">=7", "amphp/parallel": "^0.1.8 || ^0.2", - "amphp/amp": "^2", + "amphp/amp": "^2.0.3", "opis/closure": "^3.0.7" }, "require-dev": { diff --git a/test/MapTest.php b/test/MapTest.php index 6102aa4..653f8dc 100644 --- a/test/MapTest.php +++ b/test/MapTest.php @@ -14,6 +14,14 @@ class MapTest extends TestCase { }))); } + public function testCorrectOutputOrder() { + $this->assertSame([0, 1, 0], wait(parallelMap([0, 1, 0], function ($input) { + sleep($input); + + return $input; + }))); + } + public function testException() { $this->expectException(MultiReasonException::class);