Skip to content

Commit

Permalink
windowed is consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jul 29, 2015
1 parent feb1378 commit ce4c1e8
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1148,3 +1148,15 @@ let ``where is consistent`` () =
Check.QuickThrowOnFailure where<int>
Check.QuickThrowOnFailure where<string>
Check.QuickThrowOnFailure where<NormalFloat>

let windowed<'a when 'a : equality> (xs : 'a []) windowSize =
let s = run (fun () -> xs |> Seq.windowed windowSize |> Seq.toArray |> Array.map Seq.toArray)
let l = run (fun () -> xs |> List.ofArray |> List.windowed windowSize |> List.toArray |> Array.map Seq.toArray)
let a = run (fun () -> xs |> Array.windowed windowSize)
s = a && l = a

[<Test>]
let ``windowed is consistent`` () =
Check.QuickThrowOnFailure windowed<int>
Check.QuickThrowOnFailure windowed<string>
Check.QuickThrowOnFailure windowed<NormalFloat>

0 comments on commit ce4c1e8

Please sign in to comment.