Skip to content

Commit 4ede597

Browse files
committed
Fix minimum requirement for amphp/amp
This ensures that elements are ordered correctly.
1 parent ca55bd1 commit 4ede597

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"require": {
2626
"php": ">=7",
2727
"amphp/parallel": "^0.1.8 || ^0.2",
28-
"amphp/amp": "^2",
28+
"amphp/amp": "^2.0.3",
2929
"opis/closure": "^3.0.7"
3030
},
3131
"require-dev": {

test/MapTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ public function testValidInput() {
1414
})));
1515
}
1616

17+
public function testCorrectOutputOrder() {
18+
$this->assertSame([0, 1, 0], wait(parallelMap([0, 1, 0], function ($input) {
19+
sleep($input);
20+
21+
return $input;
22+
})));
23+
}
24+
1725
public function testException() {
1826
$this->expectException(MultiReasonException::class);
1927

0 commit comments

Comments
 (0)