haf / expecto

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

Index out of range exception #396

Closed vilinski closed 3 years ago

vilinski commented 3 years ago

Exception is thrown in combination with --stress and --filter options if filter returns no test cases:

$ dotnet run --list-tests
suite.test1
suite.test2
$dotnet run --filter "no such tests" --stress 1
$dotnet run --summary --filter "no such tests" --stress 1
Unhandled exception. System.ArgumentException: Der Index war außerhalb des Bereichs von Elementen in der Liste. (Parameter 'index')
   at Microsoft.FSharp.Collections.ListModule.Item[T](Int32 index, FSharpList`1 list) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\list.fs:line 141
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.FSharp.Collections.Internal.IEnumerator.getCurrent@238[TResult](FSharpFunc`2 f, FSharpRef`1 index, FSharpRef`1 current, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 245
   at Microsoft.FSharp.Collections.Internal.IEnumerator.upto@246.System-Collections-Generic-IEnumerator`1-get_Current() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 247
   at Microsoft.FSharp.Collections.Generator.Microsoft-FSharp-Collections-Generator-Generator-1-get_Apply@420-1.Invoke(Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 422
   at Microsoft.FSharp.Collections.Generator.appG[a](Generator`1 g) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 316
   at Microsoft.FSharp.Collections.Generator.EnumeratorWrappingLazyGenerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.TakeWhile@1308.GenerateNext(IEnumerable`1& next) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1310
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 371
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 403
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 77
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
   at Microsoft.FSharp.Control.AsyncPrimitives.CreateWhileAsync(FSharpFunc`2 guardFunc, FSharpAsync`1 computation) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 604
   at Expecto.Async.foldSequentiallyWithCancel@18-3.Invoke(IEnumerator`1 _arg2)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 398
   at Microsoft.FSharp.Control.AsyncPrimitives.unitAsync@589.Invoke(AsyncActivation`1 ctxt) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 589
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 109
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 350
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a](CancellationToken cancellationToken, FSharpAsync`1 computation) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 882
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 890
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1154
   at Expecto.Tests.runTestsWithCancel(CancellationToken ct, ExpectoConfig config, Test tests)
   at Expecto.Tests.runTestsWithArgsAndCancel(CancellationToken ct, ExpectoConfig config, String[] args, Test tests)
   at Expecto.Tests.runTestsInAssemblyWithCancel(CancellationToken ct, ExpectoConfig config, String[] args)
   at Expecto.Tests.runTestsInAssembly(ExpectoConfig config, String[] args)
haf commented 3 years ago

Thanks for reporting