mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-10 03:28:40 +00:00
Rename from the rather bland "TestRunner" (#61)
This commit is contained in:
20
WoofWare.NUnitTestRunner.Lib/Array.fs
Normal file
20
WoofWare.NUnitTestRunner.Lib/Array.fs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace WoofWare.NUnitTestRunner
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module internal Array =
|
||||
|
||||
let allOkOrError<'o, 'e> (a : Result<'o, 'e>[]) : Result<'o[], 'o[] * 'e[]> =
|
||||
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.ToArray ()
|
||||
|
||||
if errors.Count = 0 then
|
||||
Ok oks
|
||||
else
|
||||
Error (oks, errors.ToArray ())
|
Reference in New Issue
Block a user