haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
668 stars 96 forks source link

`Expecto.Flip.Expect.isOk: message:string -> r:Result<'ok,_> -> 'ok` #247

Closed haf closed 3 years ago

haf commented 6 years ago

When using Expecto.Flip.Expect (or plain Expecto.Expect), it would be great if most assertions would yield the "inner" or "extracted" value if possible.

This would be a breaking change, but it would be a very nice change and you'd get compiler warnings for all things that now return values. A naming convention for things not returning the values should be set up, too.

This issues is 1) discussion, 2) implementation, but it's a very easy contribution, so this is a nice issue to get started on.

jwosty commented 6 years ago

This would be nice. If this is done then also should be done for Expect.isSome.

Perhaps the function could be called something else though so that it's backwards compatible -- maybe getOk? Or could be put in another namespace+module that could be opened (like Flip)?

teo-tsirpanis commented 3 years ago

This issue has been fixed by #376.