Skip to content

Commit

Permalink
zip3 and unzip3 are dual
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jul 29, 2015
1 parent 1eccbb9 commit da09cec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ let ``zip and unzip are dual`` () =
Check.QuickThrowOnFailure zip_and_unzip<string>
Check.QuickThrowOnFailure zip_and_unzip<NormalFloat>

let zip3_and_unzip3<'a when 'a : equality> (xs' : ('a*'a*'a) list) =
let xs,xs2,xs3 = List.unzip3 xs'
List.zip3 xs xs2 xs3 = xs'

[<Test>]
let ``zip3 and unzip3 are dual`` () =
Check.QuickThrowOnFailure zip3_and_unzip3<int>
Check.QuickThrowOnFailure zip3_and_unzip3<string>
Check.QuickThrowOnFailure zip3_and_unzip3<NormalFloat>

[<Test>]
let ``splitInto produces chunks exactly `count` chunks with equal size (+/- 1)``() =
let prop (a: _ list) (PositiveInt count') =
Expand Down

0 comments on commit da09cec

Please sign in to comment.