Skip to content

Commit f7c9620

Browse files
committed
update tests
1 parent f27a573 commit f7c9620

File tree

1 file changed

+26
-37
lines changed

1 file changed

+26
-37
lines changed

tests/FSharp.Compiler.ComponentTests/Language/UseBangBindingsTests.fs

+26-37
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Language
44

5+
open FSharp.Test
56
open Xunit
67
open FSharp.Test.Compiler
78

@@ -39,7 +40,7 @@ let main _ =
3940
(Error 1228, Line 16, Col 10, Line 16, Col 11, "'use!' bindings must be of the form 'use! <var> = <expr>'")
4041
]
4142

42-
[<Fact>]
43+
[<FactForNETCOREAPP>]
4344
let ``Named patterns are allowed in use! binding`` () =
4445
FSharp """
4546
module Program
@@ -66,11 +67,9 @@ let main _ =
6667
|> shouldSucceed
6768
|> run
6869
|> 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"
7473

7574
[<Fact>]
7675
let ``Both named and discard patterns in custom computation expression use! binding`` () =
@@ -125,10 +124,8 @@ let main _ =
125124
|> shouldSucceed
126125
|> run
127126
|> 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"
132129

133130
module UseBangBindingsPreviewTests =
134131
[<Fact>]
@@ -171,18 +168,16 @@ let main _ =
171168
|> shouldSucceed
172169
|> run
173170
|> 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>]
186181
let ``Discard pattern allowed in async use! binding 2`` () =
187182
FSharp """
188183
module Program
@@ -210,12 +205,10 @@ let main _ =
210205
|> shouldSucceed
211206
|> run
212207
|> 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"
219212

220213
[<Fact>]
221214
let ``Both named and discard patterns in custom computation expression use! binding`` () =
@@ -271,11 +264,9 @@ let main _ =
271264
|> shouldSucceed
272265
|> run
273266
|> 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"
279270

280271
[<Fact>]
281272
let ``Discard patterns are allowed in use and use! binding`` () =
@@ -330,7 +321,5 @@ let main _ =
330321
|> shouldSucceed
331322
|> run
332323
|> 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

Comments
 (0)