diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Append.Tests.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Append.Tests.fs index 3201019..9311cab 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Append.Tests.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Append.Tests.fs @@ -93,8 +93,8 @@ module SideEffects = |> validateSequence |> Task.map (fun () -> i |> should equal 2) - [)>] - let ``TaskSeq-appendSeq consumes whole sequence once incl after-effects`` variant = + [] + let ``TaskSeq-appendSeq consumes whole sequence once incl after-effects`` () = let mutable i = 0 let ts = taskSeq { @@ -108,8 +108,8 @@ module SideEffects = |> validateSequence |> Task.map (fun () -> i |> should equal 2) - [)>] - let ``TaskSeq-prependSeq consumes whole sequence once incl after-effects`` variant = + [] + let ``TaskSeq-prependSeq consumes whole sequence once incl after-effects`` () = let mutable i = 0 taskSeq { diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Except.Tests.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Except.Tests.fs index db49b2c..9054abb 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Except.Tests.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Except.Tests.fs @@ -54,12 +54,14 @@ module EmptySeq = let ``TaskSeq-except no side effect in exclude seq if source seq is empty`` variant = let mutable i = 0 + // argument of TaskSeq.exclude is only iterated once we get the first item + // from the input. With empty input, this is not evaluated let exclude = taskSeq { - i <- i + 1 + i <- i + 1 // we test that we never get here yield 12 } - TaskSeq.empty + Gen.getEmptyVariant variant |> TaskSeq.except exclude |> verifyEmpty |> Task.map (fun () -> i |> should equal 0) // exclude seq is only enumerated after first item in source @@ -96,8 +98,8 @@ module Immutable = |> TaskSeq.except (Gen.getSeqImmutable variant) |> verifyEmpty - [)>] - let ``TaskSeq-exceptOfSeq removes duplicates`` variant = + [] + let ``TaskSeq-exceptOfSeq removes duplicates`` () = TaskSeq.ofList [ 1; 1; 2; 3; 4; 12; 12; 12; 13; 13; 13; 13; 13; 99 ] |> TaskSeq.exceptOfSeq [ 1..10 ] |> TaskSeq.toArrayAsync diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Pick.Tests.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Pick.Tests.fs index e03c236..2b77392 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Pick.Tests.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Pick.Tests.fs @@ -126,8 +126,8 @@ module Immutable = twentyFive |> should equal "foo" } - [)>] - let ``TaskSeq-pick happy path first item of seq`` variant = task { + [] + let ``TaskSeq-pick happy path first item of seq`` () = task { let! first = Gen.sideEffectTaskSeqMicro 50L<µs> 1000L<µs> 50 |> TaskSeq.pick (fun x -> if x = 1 then Some $"first{x}" else None) // dummy tasks seq starts at 1 diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Realworld.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Realworld.fs index ac9baee..33eed11 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Realworld.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Realworld.fs @@ -44,8 +44,6 @@ type AsyncBufferedReader(_output: ITestOutputHelper, data, blockSize) = let! bytesRead = buffered.ReadAsync(mem, 0, mem.Length) // offset refers to offset in target buffer, not source lastPos <- buffered.Position - let x: seq = seq { 1 } |> Seq.cast - if bytesRead > 0 then current <- ValueSome mem return true @@ -102,11 +100,14 @@ type ``Real world tests``(output: ITestOutputHelper) = [] let ``Reading a 10MB buffered IAsync stream from start to finish`` () = task { + // TODO: fix this test Remove underscores of the vars and rerun the test with + // all lined uncommented let mutable count = 0 - use reader = AsyncBufferedReader(output, Array.init 2048 byte, 256) + use reader = new AsyncBufferedReader(output, Array.init 2048 byte, 256) let expected = Array.init 256 byte - let ts = taskSeq { + // TODO: use this + let _ts = taskSeq { for data in reader do do count <- count + 1 @@ -116,7 +117,7 @@ type ``Real world tests``(output: ITestOutputHelper) = yield data } - // the following is extremely slow, which is why we just use F#'s comparison instead + // the following is extremely slow in XUnit/FsUnit, which is why we just use F#'s comparison instead // Using this takes 67s, compared to 0.25s using normal F# comparison. // reader |> TaskSeq.toArray |> should equal expected // VERY SLOW!! diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.ToXXX.Tests.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.ToXXX.Tests.fs index 082fe98..d43e87e 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.ToXXX.Tests.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.ToXXX.Tests.fs @@ -138,7 +138,7 @@ module SideEffects = [)>] let ``TaskSeq-toListAsync should execute side effects multiple times`` variant = task { - let tq = Gen.sideEffectTaskSeq 10 + let tq = Gen.getSeqWithSideEffect variant let! (results1: list<_>) = tq |> TaskSeq.toListAsync let! (results2: list<_>) = tq |> TaskSeq.toListAsync results1 |> should equal [ 1..10 ]