Skip to content

Commit

Permalink
zip can be reversed with unzip
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jul 29, 2015
1 parent ec7ba49 commit a5d635f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ let ``two zips can be used for zip3`` () =
Check.QuickThrowOnFailure zip_and_zip3<string>
Check.QuickThrowOnFailure zip_and_zip3<NormalFloat>

let zip_and_unzip<'a when 'a : equality> (xs' : ('a*'a) list) =
let xs,xs2 = List.unzip xs'
List.zip xs xs2 = xs'

[<Test>]
let ``zip can be reversed with unzip`` () =
Check.QuickThrowOnFailure zip_and_unzip<int>
Check.QuickThrowOnFailure zip_and_unzip<string>
Check.QuickThrowOnFailure zip_and_unzip<NormalFloat>

[<Test>]
let ``splitInto produces chunks exactly `count` chunks with equal size (+/- 1)``() =
Expand Down

0 comments on commit a5d635f

Please sign in to comment.