Obtain a compatible runtime from runconfig (#35)

This commit is contained in:
Patrick Stevens
2024-06-07 20:22:43 +01:00
committed by GitHub
parent 9a0eb1d8fc
commit 4c2045c3ec
7 changed files with 194 additions and 1 deletions

22
TestRunner/Seq.fs Normal file
View File

@@ -0,0 +1,22 @@
namespace TestRunner
[<RequireQualifiedAccess>]
module internal Seq =
let tryMinBy (f : 'a -> 'b) (s : 'a seq) : 'a option =
use enum = s.GetEnumerator ()
if not (enum.MoveNext ()) then
None
else
let mutable answer = enum.Current
let mutable fAnswer = f enum.Current
while enum.MoveNext () do
let fNext = f enum.Current
if fNext < fAnswer then
answer <- enum.Current
Some answer