#r "nuget:FSharp.Collections.Immutable"
#r "nuget:Unquote"
open FSharp.Collections.Immutable
open Swensen.Unquote.Assertions
let xs = [ "one"; "two"; "three"; "four" ]
let xsIL = ImmutableList.ofList xs
let xsA = Array.ofList xs
let notThree = (<>) "three"
test <@ (xsIL |> ImmutableList.skipWhile notThree |> ImmutableList.toArray) = (xsA |> Array.skipWhile notThree) @>
test <@ (xsIL |> ImmutableList.takeWhile notThree |> ImmutableList.toArray) = (xsA |> Array.takeWhile notThree) @>
Test failed:
xsIL |> (fun list -> ImmutableList.skipWhile notThree list) |> ImmutableList.toArray = (xsA |> (fun array -> Array.skipWhile notThree array))
seq ["one"; "two"; "three"; "four"] |> (fun list -> ImmutableList.skipWhile notThree list) |> ImmutableList.toArray = ([|"one"; "two"; "three"; "four"|] |> (fun array -> Array.skipWhile notThree array))
seq ["one"; "two"] |> ImmutableList.toArray = [|"three"; "four"|]
[|"one"; "two"|] = [|"three"; "four"|]
false
Test failed:
xsIL |> (fun list -> ImmutableList.takeWhile notThree list) |> ImmutableList.toArray = (xsA |> (fun array -> Array.takeWhile notThree array))
seq ["one"; "two"; "three"; "four"] |> (fun list -> ImmutableList.takeWhile notThree list) |> ImmutableList.toArray = ([|"one"; "two"; "three"; "four"|] |> (fun array -> Array.takeWhile notThree array))
seq ["three"; "four"] |> ImmutableList.toArray = [|"one"; "two"|]
[|"three"; "four"|] = [|"one"; "two"|]
false