From 453bcd5b4e5778362e603253a3b97f1d128c1ed6 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 17 Jun 2015 13:01:06 +0200 Subject: [PATCH] exists is consistent --- .../CollectionModulesConsistency.fs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fsharp/FSharp.Core.PropertyTests/CollectionModulesConsistency.fs b/src/fsharp/FSharp.Core.PropertyTests/CollectionModulesConsistency.fs index 4f2920eb1c6..cd0080492b0 100644 --- a/src/fsharp/FSharp.Core.PropertyTests/CollectionModulesConsistency.fs +++ b/src/fsharp/FSharp.Core.PropertyTests/CollectionModulesConsistency.fs @@ -191,6 +191,18 @@ let ``except is consistent`` () = Check.QuickThrowOnFailure except Check.QuickThrowOnFailure except +let exists<'a when 'a : equality> (xs : 'a []) f = + let s = xs |> Seq.exists f + let l = xs |> List.ofArray |> List.exists f + let a = xs |> Array.exists f + s = a && l = a + +[] +let ``exists is consistent`` () = + Check.QuickThrowOnFailure exists + Check.QuickThrowOnFailure exists + Check.QuickThrowOnFailure exists + let sort<'a when 'a : comparison> (xs : 'a []) = let s = xs |> Seq.sort let l = xs |> List.ofArray |> List.sort