Skip to content

Commit

Permalink
Clarify test use-cases by using clearer syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
abelbraaksma committed Dec 21, 2023
1 parent 17aa445 commit 7802df6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.SkipWhile.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module Immutable =

do!
Gen.getSeqImmutable variant
|> TaskSeq.skipWhile ((>) 5) // skip while less than 5
|> TaskSeq.skipWhile (fun x -> x < 5)
|> verifyDigitsAsString "EFGHIJ"

do!
Expand Down Expand Up @@ -104,7 +104,7 @@ module Immutable =

do!
Gen.getSeqImmutable variant
|> TaskSeq.skipWhileInclusive ((>) 5)
|> TaskSeq.skipWhileInclusive (fun x -> x < 5)
|> verifyDigitsAsString "FGHIJ" // last 4

do!
Expand All @@ -118,12 +118,12 @@ module Immutable =
let ``TaskSeq-skipWhileInclusive+A returns the empty sequence if always true`` variant = task {
do!
Gen.getSeqImmutable variant
|> TaskSeq.skipWhileInclusive ((<) -1)
|> TaskSeq.skipWhileInclusive (fun x -> x > -1) // always true
|> verifyEmpty

do!
Gen.getSeqImmutable variant
|> TaskSeq.skipWhileInclusiveAsync (fun x -> task { return true })
|> TaskSeq.skipWhileInclusiveAsync (fun x -> Task.fromResult (x > -1))
|> verifyEmpty
}

Expand Down Expand Up @@ -151,7 +151,7 @@ module SideEffects =

do!
Gen.getSeqWithSideEffect variant
|> TaskSeq.skipWhile ((>) 6)
|> TaskSeq.skipWhile (fun x -> x < 6)
|> verifyDigitsAsString "FGHIJ"

do!
Expand All @@ -170,7 +170,7 @@ module SideEffects =

do!
Gen.getSeqWithSideEffect variant
|> TaskSeq.skipWhileInclusive ((>) 6)
|> TaskSeq.skipWhileInclusive (fun x -> x < 6)
|> verifyDigitsAsString "GHIJ"

do!
Expand Down Expand Up @@ -213,7 +213,7 @@ module SideEffects =
[<InlineData(true, true)>]
let ``TaskSeq-skipWhileXXX prove side effects are properly executed`` (inclusive, isAsync) = task {
let mutable x = 41
let functionToTest = getFunction inclusive isAsync ((>) 50)
let functionToTest = getFunction inclusive isAsync (fun x -> x < 50)

let items = taskSeq {
x <- x + 1
Expand Down

0 comments on commit 7802df6

Please sign in to comment.