Skip to content

Annotate dead code #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.Append.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module SideEffects =

[<Theory; ClassData(typeof<TestImmTaskSeq>)>]
let ``TaskSeq-appendSeq consumes whole sequence once incl after-effects`` variant =
// TODO use variant
let mutable i = 0

let ts = taskSeq {
Expand All @@ -110,6 +111,7 @@ module SideEffects =

[<Theory; ClassData(typeof<TestImmTaskSeq>)>]
let ``TaskSeq-prependSeq consumes whole sequence once incl after-effects`` variant =
// TODO use variant
let mutable i = 0

taskSeq {
Expand Down
2 changes: 2 additions & 0 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.Except.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module EmptySeq =

[<Theory; ClassData(typeof<TestEmptyVariants>)>]
let ``TaskSeq-except no side effect in exclude seq if source seq is empty`` variant =
// TODO use variant
let mutable i = 0

let exclude = taskSeq {
Expand Down Expand Up @@ -98,6 +99,7 @@ module Immutable =

[<Theory; ClassData(typeof<TestImmTaskSeq>)>]
let ``TaskSeq-exceptOfSeq removes duplicates`` variant =
// TODO use variant
TaskSeq.ofList [ 1; 1; 2; 3; 4; 12; 12; 12; 13; 13; 13; 13; 13; 99 ]
|> TaskSeq.exceptOfSeq [ 1..10 ]
|> TaskSeq.toArrayAsync
Expand Down
1 change: 1 addition & 0 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.Pick.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ module Immutable =

[<Theory; ClassData(typeof<TestImmTaskSeq>)>]
let ``TaskSeq-pick happy path first item of seq`` variant = task {
// TODO use variant
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
Expand Down
13 changes: 0 additions & 13 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.Realworld.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Guid> = seq { 1 } |> Seq.cast

if bytesRead > 0 then
current <- ValueSome mem
return true
Expand Down Expand Up @@ -102,20 +100,9 @@ type ``Real world tests``(output: ITestOutputHelper) =

[<Fact(Skip = "Broken test, faulty streaming test-implementation")>]
let ``Reading a 10MB buffered IAsync stream from start to finish`` () = task {
let mutable count = 0
use reader = AsyncBufferedReader(output, Array.init 2048 byte, 256)
let expected = Array.init 256 byte

let ts = taskSeq {
for data in reader do
do count <- count + 1

if count > 40960 then
failwith "Too far!!!!!!" // ensuring we don't end up in an endless loop

yield data
}

// the following is extremely slow, 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!!
Expand Down
1 change: 1 addition & 0 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.ToXXX.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module SideEffects =

[<Theory; ClassData(typeof<TestSideEffectTaskSeq>)>]
let ``TaskSeq-toListAsync should execute side effects multiple times`` variant = task {
// TODO use variant
let tq = Gen.sideEffectTaskSeq 10
let! (results1: list<_>) = tq |> TaskSeq.toListAsync
let! (results2: list<_>) = tq |> TaskSeq.toListAsync
Expand Down