diff --git a/CHANGELOG.md b/CHANGELOG.md index f2fd928..f3ca751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 5.1.0 - 2023-07-14 + +### Added + +- `Innmind\BlackBox\Set\Call` + ## 5.0.0 - 2023-05-29 ### Added diff --git a/proofs/set/call.php b/proofs/set/call.php new file mode 100644 index 0000000..a246e39 --- /dev/null +++ b/proofs/set/call.php @@ -0,0 +1,21 @@ + new \stdClass); + + $assert + ->expected($set->values(Random::default)->current()->unwrap()) + ->not() + ->same($set->values(Random::default)->current()->unwrap()); + }, + ); +}; diff --git a/src/Set/Call.php b/src/Set/Call.php new file mode 100644 index 0000000..c0bf265 --- /dev/null +++ b/src/Set/Call.php @@ -0,0 +1,25 @@ + + */ + public static function of(callable $call): Set + { + return FromGenerator::of(static function() use ($call) { + while (true) { + yield $call(); + } + }); + } +}