Lwtreslib: Option.filter* and fuzz-testing options
Context
Salut. Cela fait plusieurs fois maintenant que je relis du code qui suit le motif suivant:
match ... with Some s when p s -> Some s | _ -> NoneA-t-on une fonction qui fait déjà ça dans la codebase? Sinon, pourrait-on rajouter
By popular* demand, here are Option.filter and friends with a battery of tests.
*: with a population lower bound of 1
Manually testing the MR
dune runtest src/lib_lwt_result_stdlib
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) - N/A Document any change to the user interface, including configuration parameters (see node configuration)
-
Provide automatic testing (see the testing guide). - N/A For new features and bug fixes, add an item in the appropriate changelog (
docs/protocols/alpha.rstfor the protocol and the environment, theDevelopment Versionsection ofCHANGES.mdfor everything else). -
Select suitable reviewers using the Reviewersfield below.
Edited by Raphaël Proust