Skip to content

Improve data variety for data-driven tests (immutable, vs mutable, vs thread-yield, vs hot-delayed) plus massive refactoring#55

Merged
abelbraaksma merged 11 commits intomainfrom
more-data-driven-tests
Oct 31, 2022
Merged

Improve data variety for data-driven tests (immutable, vs mutable, vs thread-yield, vs hot-delayed) plus massive refactoring#55
abelbraaksma merged 11 commits intomainfrom
more-data-driven-tests

Conversation

@abelbraaksma
Copy link
Copy Markdown
Member

Basically as in the title. We now have these sequences, each returning either an empty sequence variant, or a sequence 1..10, either with mutable data on each enumeration, using byref data, plain old mutable, or let bindings, using spin delays or thread-yielding delays, or deeply nested taskSeq.

These types work with Theory and ClassData. Just pass it this class name:

    type TestEmptyVariants() as this =
        inherit TheoryData<EmptyVariant>()

        do
            this.Add EmptyVariant.CallEmpty
            this.Add EmptyVariant.Do
            this.Add EmptyVariant.DoBang
            this.Add EmptyVariant.YieldBang
            this.Add EmptyVariant.YieldBangNested
            this.Add EmptyVariant.DelayDoBang
            this.Add EmptyVariant.DelayYieldBang
            this.Add EmptyVariant.DelayYieldBangNested

    type TestImmTaskSeq() as this =
        inherit TheoryData<SeqImmutable>()

        do
            this.Add SeqImmutable.Sequential_YieldBang
            this.Add SeqImmutable.Sequential_Yield
            this.Add SeqImmutable.Sequential_For
            this.Add SeqImmutable.Sequential_Combine
            this.Add SeqImmutable.Sequential_Zero
            this.Add SeqImmutable.ThreadSpinWait
            this.Add SeqImmutable.AsyncYielded
            this.Add SeqImmutable.AsyncYielded_Nested

    type TestSideEffectTaskSeq() as this =
        inherit TheoryData<SeqWithSideEffect>()

        do
            this.Add SeqWithSideEffect.Sequential_YieldBang
            this.Add SeqWithSideEffect.Sequential_Yield
            this.Add SeqWithSideEffect.Sequential_For
            this.Add SeqWithSideEffect.Sequential_Combine
            this.Add SeqWithSideEffect.Sequential_Zero
            this.Add SeqWithSideEffect.ThreadSpinWait
            this.Add SeqWithSideEffect.AsyncYielded
            this.Add SeqWithSideEffect.AsyncYielded_Nested

@abelbraaksma abelbraaksma force-pushed the more-data-driven-tests branch from 2cc2879 to 9417e7b Compare October 31, 2022 02:51
@abelbraaksma
Copy link
Copy Markdown
Member Author

Let's get this in, we'll apply these changes to the other tests soon(ish)

@abelbraaksma abelbraaksma merged commit 27486f3 into main Oct 31, 2022
@abelbraaksma abelbraaksma deleted the more-data-driven-tests branch October 31, 2022 21:02
@abelbraaksma abelbraaksma added this to the v0.1.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant