2
2
3
3
namespace Language
4
4
5
+ open FSharp.Test
5
6
open Xunit
6
7
open FSharp.Test .Compiler
7
8
@@ -39,7 +40,7 @@ let main _ =
39
40
( Error 1228 , Line 16 , Col 10 , Line 16 , Col 11 , " 'use!' bindings must be of the form 'use! <var> = <expr>'" )
40
41
]
41
42
42
- [<Fact >]
43
+ [<FactForNETCOREAPP >]
43
44
let ``Named patterns are allowed in use ! binding`` () =
44
45
FSharp """
45
46
module Program
@@ -66,11 +67,9 @@ let main _ =
66
67
|> shouldSucceed
67
68
|> run
68
69
|> shouldSucceed
69
- |> withOutputContainsAllInOrder [
70
- " disposed 1"
71
- " disposed 3"
72
- " disposed 2"
73
- ]
70
+ |> withStdOutContains " disposed 1"
71
+ |> withStdOutContains " disposed 2"
72
+ |> withStdOutContains " disposed 3"
74
73
75
74
[<Fact>]
76
75
let ``Both named and discard patterns in custom computation expression use ! binding`` () =
@@ -125,10 +124,8 @@ let main _ =
125
124
|> shouldSucceed
126
125
|> run
127
126
|> shouldSucceed
128
- |> withOutputContainsAllInOrder [
129
- " Counter with value 4 disposed"
130
- " Counter with value 5 disposed"
131
- ]
127
+ |> withStdOutContains " Counter with value 4 disposed"
128
+ |> withStdOutContains " Counter with value 5 disposed"
132
129
133
130
module UseBangBindingsPreviewTests =
134
131
[<Fact>]
@@ -171,18 +168,16 @@ let main _ =
171
168
|> shouldSucceed
172
169
|> run
173
170
|> shouldSucceed
174
- |> withOutputContainsAllInOrder [
175
- " Starting async workflow"
176
- " Created counter with value 5"
177
- " Created counter with value 4"
178
- " Created counter with value 3"
179
- " Done using the resource"
180
- " Counter with value 3 disposed"
181
- " Counter with value 4 disposed"
182
- " Counter with value 5 disposed"
183
- ]
184
-
185
- [<Fact>]
171
+ |> withStdOutContains " Starting async workflow"
172
+ |> withStdOutContains " Created counter with value 5"
173
+ |> withStdOutContains " Created counter with value 4"
174
+ |> withStdOutContains " Created counter with value 3"
175
+ |> withStdOutContains " Done using the resource"
176
+ |> withStdOutContains " Counter with value 3 disposed"
177
+ |> withStdOutContains " Counter with value 4 disposed"
178
+ |> withStdOutContains " Counter with value 5 disposed"
179
+
180
+ [<FactForNETCOREAPP>]
186
181
let ``Discard pattern allowed in async use ! binding 2`` () =
187
182
FSharp """
188
183
module Program
@@ -210,12 +205,10 @@ let main _ =
210
205
|> shouldSucceed
211
206
|> run
212
207
|> shouldSucceed
213
- |> withOutputContainsAllInOrder [
214
- " disposed 1"
215
- " disposed 4"
216
- " disposed 3"
217
- " disposed 2"
218
- ]
208
+ |> withStdOutContains " disposed 1"
209
+ |> withStdOutContains " disposed 2"
210
+ |> withStdOutContains " disposed 3"
211
+ |> withStdOutContains " disposed 4"
219
212
220
213
[<Fact>]
221
214
let ``Both named and discard patterns in custom computation expression use ! binding`` () =
@@ -271,11 +264,9 @@ let main _ =
271
264
|> shouldSucceed
272
265
|> run
273
266
|> shouldSucceed
274
- |> withOutputContainsAllInOrder [
275
- " Counter with value 3 disposed"
276
- " Counter with value 4 disposed"
277
- " Counter with value 5 disposed"
278
- ]
267
+ |> withStdOutContains " Counter with value 3 disposed"
268
+ |> withStdOutContains " Counter with value 4 disposed"
269
+ |> withStdOutContains " Counter with value 5 disposed"
279
270
280
271
[<Fact>]
281
272
let ``Discard patterns are allowed in use and use ! binding`` () =
@@ -330,7 +321,5 @@ let main _ =
330
321
|> shouldSucceed
331
322
|> run
332
323
|> shouldSucceed
333
- |> withOutputContainsAllInOrder [
334
- " Counter with value 2 disposed"
335
- " disposed 1"
336
- ]
324
+ |> withStdOutContains " disposed 1"
325
+ |> withStdOutContains " Counter with value 2 disposed"
0 commit comments