@@ -28,7 +28,7 @@ module Collections =
2828
2929 #if TEST_ TRACE
3030 CollectionAssert.AreEqual ([ " ChunkBy, list<'T>" ], Traces.get())
31- #endif
31+ #endif
3232
3333
3434 let testCollections =
@@ -53,6 +53,11 @@ module Collections =
5353
5454
5555 let testSeqConversions =
56+
57+ #if TEST_ TRACE
58+ Traces.reset()
59+ #endif
60+
5661 let sk : Generic.Stack < _ > = ofSeq { 1 .. 3 }
5762 let sg : string = ofSeq { '1' .. '3' } // but it will come back as seq<char>
5863 let sb : Text.StringBuilder = ofSeq { '1' .. '3' } // but it will come back as seq<char>
@@ -77,12 +82,29 @@ module Collections =
7782 let _r : IReadOnlyDictionary < _ , _ > = ofSeq ( seq [ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
7883 let rc : IReadOnlyCollection < _ > = ofSeq ( seq [ 2 .. 7 ])
7984 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+
8090 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+
8295 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>
83106 let cd : ConcurrentDictionary < _ , _ > = ofSeq ( seq [( 1 , " One" ); ( 2 , " Two" )]) // but it will come back as ...
84107 let _cd : ConcurrentDictionary < _ , _ > = ofSeq ( seq [ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
85- let cb : ConcurrentBag < _ > = ofSeq { '1' .. '3' }
86108
87109 // now go back
88110 let _sk ' = toSeq sk
@@ -120,7 +142,15 @@ module Collections =
120142 let _cols = columns |> toList |> map ( fun x -> x.ColumnName)
121143
122144 // Defaults
145+
146+ #if TEST_ TRACE
147+ CollectionAssert.AreEqual ([ " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ; " OfSeq, Default2-#Add" ], Traces.get())
148+ #endif
149+
123150 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
124154
125155 ()
126156
@@ -151,12 +181,30 @@ module Collections =
151181 let _r : IReadOnlyDictionary < _ , _ > = ofList ([ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
152182 let rc : IReadOnlyCollection < _ > = ofList ([ 2 .. 5 ])
153183 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+
154189 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+
155205 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>
157206 let cd : ConcurrentDictionary < _ , _ > = ofList ([( 1 , " One" ); ( 2 , " Two" )]) // but it will come back as ...
158207 let _cd : ConcurrentDictionary < _ , _ > = ofList ([ KeyValuePair( 1 , " One" ); KeyValuePair( 2 , " Two" )])
159- let cb : ConcurrentBag < _ > = ofList [ '1' .. '3' ]
160208
161209 // now go back
162210 let _sk ' = toList sk
0 commit comments