Skip to content

Commit d21c5c2

Browse files
Apply review comments
Co-Authored-By: Abel Braaksma <[email protected]>
1 parent bfb6938 commit d21c5c2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/FSharp.Control.TaskSeq.Test/TaskSeq.Do.Tests.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ let ``CE taskSeq: use 'do!' with a task<unit>`` () =
2222
|> Task.map (fun _ -> value |> should equal 1)
2323

2424
[<Fact>]
25-
let ``CE taskSeq: use 'do!' with a valueTask<unit>`` () =
25+
let ``CE taskSeq: use 'do!' with a ValueTask<unit>`` () =
2626
let mutable value = 0
2727

2828
taskSeq { do! ValueTask.ofTask (task { do value <- value + 1 }) }
2929
|> verifyEmpty
3030
|> Task.map (fun _ -> value |> should equal 1)
3131

3232
[<Fact>]
33-
let ``CE taskSeq: use 'do!' with a non-generic valueTask`` () =
33+
let ``CE taskSeq: use 'do!' with a non-generic ValueTask`` () =
3434
let mutable value = 0
3535

3636
taskSeq { do! ValueTask(task { do value <- value + 1 }) }
@@ -92,8 +92,8 @@ let ``CE taskSeq: use 'do!' with all kinds of overloads at once`` () =
9292
do! task { do value <- value + 1 } |> Task.ignore
9393
do! ValueTask <| task { do value <- value + 1 }
9494
do! ValueTask.ofTask (task { do value <- value + 1 })
95-
do! ValueTask<_>(()) // unit valueTask that completes immediately
96-
do! Task.fromResult () // unit Task that completes immediately
95+
do! ValueTask<_>(()) // unit ValueTask that completes immediately
96+
do! Task.fromResult (()) // unit Task that completes immediately
9797
do! Task.Delay 0
9898
do! Async.Sleep 0
9999
do! async { value <- value + 1 } // eq 4

src/FSharp.Control.TaskSeq.Test/TaskSeq.Let.Tests.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ let ``CE taskSeq: use 'let!' with a task<string>`` () =
4040
|> Task.map (should equal "test")
4141

4242
[<Fact>]
43-
let ``CE taskSeq: use 'let!' with a valueTask<unit>`` () =
43+
let ``CE taskSeq: use 'let!' with a ValueTask<unit>`` () =
4444
let mutable value = 0
4545

4646
taskSeq {
@@ -51,7 +51,7 @@ let ``CE taskSeq: use 'let!' with a valueTask<unit>`` () =
5151
|> Task.map (fun _ -> value |> should equal 1)
5252

5353
[<Fact>]
54-
let ``CE taskSeq: use 'let!' with a valueTask<string>`` () =
54+
let ``CE taskSeq: use 'let!' with a ValueTask<string>`` () =
5555
taskSeq {
5656
let! test = ValueTask.ofTask (task { return "test" })
5757
yield test
@@ -60,7 +60,7 @@ let ``CE taskSeq: use 'let!' with a valueTask<string>`` () =
6060
|> Task.map (should equal "test")
6161

6262
[<Fact>]
63-
let ``CE taskSeq: use 'let!' with a non-generic valueTask`` () =
63+
let ``CE taskSeq: use 'let!' with a non-generic ValueTask`` () =
6464
let mutable value = 0
6565

6666
taskSeq {
@@ -135,7 +135,7 @@ let ``CE taskSeq: use 'let!' with all kinds of overloads at once`` () =
135135
}
136136
|> ValueTask<int>
137137

138-
let! c = ValueTask<_>(4) // valueTask that completes immediately
138+
let! c = ValueTask<_>(4) // ValueTask that completes immediately
139139
let! _ = Task.Factory.StartNew(fun () -> value <- value + 1) // non-generic Task with side effect
140140
let! d = Task.fromResult 99 // normal Task that completes immediately
141141
let! _ = Async.Sleep 0 // unit Async

src/FSharp.Control.TaskSeq.Test/TaskSeq.StateTransitionBug.Tests.CE.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let ``CE empty taskSeq, GetAsyncEnumerator multiple times`` variant = task {
4141
[<Theory; ClassData(typeof<TestEmptyVariants>)>]
4242
let ``CE empty taskSeq, GetAsyncEnumerator multiple times and then MoveNextAsync`` variant = task {
4343
let tskSeq = Gen.getEmptyVariant variant
44-
use _enumerator = tskSeq.GetAsyncEnumerator()
44+
use _ = tskSeq.GetAsyncEnumerator()
4545
use enumerator = tskSeq.GetAsyncEnumerator()
4646
do! Assert.moveNextAndCheck false enumerator
4747
}

src/FSharp.Control.TaskSeq.Test/TestUtils.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,20 @@ type DummyTaskFactory(µsecMin: int64<µs>, µsecMax: int64<µs>) =
9595
/// <summary>
9696
/// Creates dummy tasks with a randomized delay and a mutable state,
9797
/// to ensure we properly test whether processing is done ordered or not.
98-
/// Uses the defaults for <paramref name="minMs" /> and <paramref name="maxMs" />
98+
/// Uses the defaults for <paramref name="µsecMin" /> and <paramref name="µsecMax" />
9999
/// with 10,000µs and 30,000µs respectively (or 10ms and 30ms).
100100
/// </summary>
101101
new() = DummyTaskFactory(10_000L<µs>, 30_000L<µs>)
102102

103103
/// <summary>
104104
/// Creates dummy tasks with a randomized delay and a mutable state,
105105
/// to ensure we properly test whether processing is done ordered or not.
106-
/// Values <paramref name="minMs" /> and <paramref name="maxMs" /> can be
106+
/// Values <paramref name="msecMin" /> and <paramref name="msecMax" /> can be
107107
/// given in milliseconds.
108108
/// </summary>
109109
/// <param name="minMs">Minimum delay</param>
110110
/// <param name="maxMs">Maximum delay</param>
111-
new(minMs: int<ms>, maxMs: int<ms>) = DummyTaskFactory(int64 minMs * 1000L<µs>, int64 maxMs * 1000L<µs>)
111+
new(msecMin: int<ms>, msecMax: int<ms>) = DummyTaskFactory(int64 msecMin * 1000L<µs>, int64 msecMax * 1000L<µs>)
112112

113113

114114
/// Bunch of delayed tasks that randomly have a yielding delay of 10-30ms, therefore having overlapping execution times.
@@ -318,10 +318,10 @@ module TestUtils =
318318
let getEmptyVariant variant : IAsyncEnumerable<int> =
319319
match variant with
320320
| EmptyVariant.CallEmpty -> TaskSeq.empty
321-
| EmptyVariant.Do -> taskSeq { do () }
321+
| EmptyVariant.Do -> taskSeq { do ignore () }
322322
| EmptyVariant.DoBang -> taskSeq { do! task { return () } }
323323
| EmptyVariant.YieldBang -> taskSeq { yield! Seq.empty<int> }
324-
| EmptyVariant.YieldBangNested -> taskSeq { yield! taskSeq { do () } }
324+
| EmptyVariant.YieldBangNested -> taskSeq { yield! taskSeq { do ignore () } }
325325
| EmptyVariant.DelayDoBang -> taskSeq {
326326
do! microDelay ()
327327
do! microDelay ()

0 commit comments

Comments
 (0)