@@ -27,7 +27,7 @@ module Collections =
27
27
28
28
#if TEST_ TRACE
29
29
CollectionAssert.AreEqual ([ " ChunkBy, list<'T>" ], Traces.get())
30
- #endif
30
+ #endif
31
31
32
32
33
33
let testCollections =
@@ -52,6 +52,11 @@ module Collections =
52
52
53
53
54
54
let testSeqConversions =
55
+
56
+ #if TEST_ TRACE
57
+ Traces.reset()
58
+ #endif
59
+
55
60
let sk : Generic.Stack < _ > = ofSeq { 1 .. 3 }
56
61
let sg : string = ofSeq { '1' .. '3' } // but it will come back as seq<char>
57
62
let sb : Text.StringBuilder = ofSeq { '1' .. '3' } // but it will come back as seq<char>
@@ -76,12 +81,29 @@ module Collections =
76
81
let _r : IReadOnlyDictionary < _ , _ > = ofSeq ( seq [ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
77
82
let rc : IReadOnlyCollection < _ > = ofSeq ( seq [ 2 .. 7 ])
78
83
let ut : Hashtable = ofSeq ( seq [ 1 , '1' ; 2 , '2' ; 3 , '3' ]) // but it will come back as seq<obj>
84
+
85
+ #if TEST_ TRACE
86
+ CollectionAssert.AreEqual ([], Traces.get())
87
+ #endif
88
+
79
89
let al : ArrayList = ofSeq ( seq [ " 1" ; " 2" ; " 3" ]) // but it will come back as seq<obj>
80
- let us : SortedList = ofSeq ( seq [ 4 , '2' ; 3 , '4' ]) // but it will come back as seq<obj>
90
+ #if TEST_ TRACE
91
+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ], Traces.get())
92
+ #endif
93
+
81
94
let cc : BlockingCollection < _ > = ofSeq { '1' .. '3' } // but it will come back as seq<obj>
95
+ #if TEST_ TRACE
96
+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
97
+ #endif
98
+
99
+ let cb : ConcurrentBag < _ > = ofSeq { '1' .. '3' }
100
+ #if TEST_ TRACE
101
+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
102
+ #endif
103
+
104
+ let us : SortedList = ofSeq ( seq [ 4 , '2' ; 3 , '4' ]) // but it will come back as seq<obj>
82
105
let cd : ConcurrentDictionary < _ , _ > = ofSeq ( seq [( 1 , " One" ); ( 2 , " Two" )]) // but it will come back as ...
83
106
let _cd : ConcurrentDictionary < _ , _ > = ofSeq ( seq [ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
84
- let cb : ConcurrentBag < _ > = ofSeq { '1' .. '3' }
85
107
86
108
// now go back
87
109
let _sk ' = toSeq sk
@@ -119,7 +141,15 @@ module Collections =
119
141
let _cols = columns |> toList |> map ( fun x -> x.ColumnName)
120
142
121
143
// Defaults
144
+
145
+ #if TEST_ TRACE
146
+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
147
+ #endif
148
+
122
149
let _12 : WrappedListI < _ > = seq [ 1 ; 2 ] |> ofSeq
150
+ #if TEST_ TRACE
151
+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default4-seq<'t>" ], Traces.get())
152
+ #endif
123
153
124
154
()
125
155
@@ -150,12 +180,30 @@ module Collections =
150
180
let _r : IReadOnlyDictionary < _ , _ > = ofList ([ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
151
181
let rc : IReadOnlyCollection < _ > = ofList ([ 2 .. 5 ])
152
182
let ut : Hashtable = ofList ([ 1 , '1' ; 2 , '2' ; 3 , '3' ]) // but it will come back as seq<obj>
183
+
184
+ #if TEST_ TRACE
185
+ CollectionAssert.AreEqual ([], Traces.get())
186
+ #endif
187
+
153
188
let al : ArrayList = ofList ([ " 1" ; " 2" ; " 3" ]) // but it will come back as seq<obj>
189
+ #if TEST_ TRACE
190
+ CollectionAssert.AreEqual ([ " OfList, Default2-#Add" ], Traces.get())
191
+ #endif
192
+
193
+ let cc : BlockingCollection < _ > = ofList [ '1' .. '3' ] // but it will come back as seq<obj>
194
+ #if TEST_ TRACE
195
+ CollectionAssert.AreEqual ([ " OfList, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
196
+ #endif
197
+
198
+ let cb : ConcurrentBag < _ > = ofList [ '1' .. '3' ]
199
+ #if TEST_ TRACE
200
+ CollectionAssert.AreEqual ([ " OfList, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
201
+ #endif
202
+
203
+
154
204
let us : SortedList = ofList ([ 4 , '2' ; 3 , '4' ]) // but it will come back as seq<obj>
155
- let cc : BlockingCollection < _ > = ofList [ '1' .. '3' ] // but it will come back as seq<obj>
156
205
let cd : ConcurrentDictionary < _ , _ > = ofList ([( 1 , " One" ); ( 2 , " Two" )]) // but it will come back as ...
157
206
let _cd : ConcurrentDictionary < _ , _ > = ofList ([ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
158
- let cb : ConcurrentBag < _ > = ofList [ '1' .. '3' ]
159
207
160
208
// now go back
161
209
let _sk ' = toList sk
0 commit comments