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