File tree Expand file tree Collapse file tree
src/Test/FSharp.Data.Adaptive.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,51 @@ open BenchmarkDotNet.Running
44open FSharp.Data .Traceable
55open FSharp.Data .Adaptive
66
7+
8+ open NUnit.Framework
9+ open FsCheck
10+ open FSharp.Data .Adaptive
11+ open FSharp.Data .Traceable
12+ open FsUnit
13+ open FsCheck.NUnit
14+
15+ [<Test>]
16+ let ``[ AList ] sub`` () =
17+
18+ let l = clist [ 0 .. 10 ]
19+
20+ let subbed =
21+ l
22+ |> AList.indexed
23+ |> AList.sortBy snd
24+ |> AList.sub 0 3
25+
26+ let thrd = subbed |> AList.force |> IndexList.toArray
27+ subbed |> AList.force |> printfn " %A "
28+
29+ transact ( fun _ ->
30+ l.[ fst thrd.[ 2 ]] <- 4
31+ )
32+ subbed |> AList.force |> Seq.toArray |> Array.map snd |> should equal [ 0 ; 1 ; 4 ]
33+
34+
35+ transact ( fun _ ->
36+ l.[ fst thrd.[ 2 ]] <- 5
37+ )
38+ subbed |> AList.force |> should equal [ 1 ; 2 ; 5 ]
39+
40+
41+ transact ( fun _ ->
42+ l.[ fst thrd.[ 2 ]] <- 6
43+ )
44+ subbed |> AList.force |> should equal [ 1 ; 2 ; 6 ]
45+
746[<EntryPoint>]
847let main _args =
948
49+ //``[AList] sub``();
50+
51+
1052 //let a = cval [1;2;3;4]
1153 //let b = AVal.cast<seq<int>> a
1254
You can’t perform that action at this time.
0 commit comments