Rename from the rather bland "TestRunner" (#61)

This commit is contained in:
Patrick Stevens
2024-06-10 23:25:33 +01:00
committed by GitHub
parent 181063afcd
commit ebcf0ed589
34 changed files with 602 additions and 594 deletions

View File

@@ -0,0 +1,30 @@
namespace WoofWare.NUnitTestRunner
[<RequireQualifiedAccess>]
module internal Result =
let inline getError<'r, 'e> (r : Result<'r, 'e>) : 'e option =
match r with
| Ok _ -> None
| Error e -> Some e
let get<'r, 'e> (r : Result<'r, 'e>) : 'r option =
match r with
| Ok r -> Some r
| Error _ -> None
let allOkOrError<'o, 'e> (a : Result<'o, 'e> list) : Result<'o list, 'o list * 'e list> =
let oks = ResizeArray ()
let errors = ResizeArray ()
for i in a do
match i with
| Error e -> errors.Add e
| Ok o -> oks.Add o
let oks = oks |> Seq.toList
if errors.Count = 0 then
Ok oks
else
Error (oks, Seq.toList errors)