diff --git a/src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs b/src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs index d451a3f42ca..4b502732ca3 100644 --- a/src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs +++ b/src/fsharp/FSharp.Core.PropertyTests/ListProperties.fs @@ -160,6 +160,18 @@ let ``head is the same as last of a reversed list`` () = Check.QuickThrowOnFailure head_and_last Check.QuickThrowOnFailure head_and_last +let head_and_item<'a when 'a : comparison> (xs : list<'a>) = + let a = runAndCheckErrorType (fun () -> xs |> List.item 0) + let b = runAndCheckErrorType (fun () -> List.head xs) + + a = b + +[] +let ``head is the same as item 0`` () = + Check.QuickThrowOnFailure head_and_item + Check.QuickThrowOnFailure head_and_item + Check.QuickThrowOnFailure head_and_item + let length_and_isEmpty<'a when 'a : comparison> (xs : list<'a>) = let a = List.length xs = 0 let b = List.isEmpty xs