Option and Result [was Integration tests]
Alex
sascha.orlov at gmail.com
Tue Apr 21 19:05:25 UTC 2020
On Tuesday, 21 April 2020 at 16:30:15 UTC, Russel Winder wrote:
> On Mon, 2020-04-20 at 20:19 +0000, aliak via
> Digitalmars-d-learn wrote:
>>
>> […]
>
>> [0]: https://github.com/aliak00/optional
>
> Rust has Option and Result, and most languages are rapidly
> introducing at least Option if not Result – and yes it is
> almost certain all this comes from Haskell.
>
> Is Option intended for adding to Phobos?
There is Nullable in Phobos. This is not really an Option, I
know. But just in case.
But back to integration tests, there are indeed only few
possibilities to mock something. However, the basics are there.
I found a section of code generation a while ago in std.typecons.
https://dlang.org/library/std/typecons.html
There are Black and White holes there, for example, which could
help to implement a basic mocking framework.
More information about the Digitalmars-d-learn
mailing list