test af rotation lazyqueue

 avatar
unknown
fsharp
2 years ago
740 B
2
Indexable
[<Theory>]
[<InlineData(100000)>]
[<InlineData(400000)>]
[<InlineData(800000)>]
[<InlineData(1200000)>]
[<InlineData(1600000)>]
[<InlineData(2000000)>]
[<InlineData(2400000)>]
[<InlineData(2800000)>]
[<InlineData(3200000)>]
[<InlineData(3600000)>]
let ``Rotation of LazyQueue given size:`` (testCase: int)=
    let xl = Gen.sample 100 (testCase/2) intGenerator
    let xq = Gen.sample 100 (testCase/2) intGenerator |> Seq.ofList
    let xFrontSize = (testCase/2)
    let testQueue: LazyQueue<int> = (xq, xFrontSize, xl)
    //expensive operation
    let result = cons 1 testQueue
    let _, resultFrontSize, resultBack = result
    let check1 = (resultFrontSize = (testCase+1))
    let check2 = (resultBack.Length = 0)
    check1 && check2
Editor is loading...