Skip to content

Commit 2d457dc

Browse files
committed
RecommendIfElseConstructOverMatch: added 2 more tests
1 parent d703c99 commit 2d457dc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/FSharpLint.Core.Tests/Rules/Conventions/RecommendIfElseConstructOverMatch.fs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,21 @@ match foo with
5555
| _ -> () """
5656

5757
Assert.IsTrue this.ErrorsExist
58+
59+
[<Test>]
60+
member this.TwoClausesWithNullAndWildcardShouldProduceError() =
61+
this.Parse """
62+
match foo with
63+
| null -> ()
64+
| _ -> () """
65+
66+
Assert.IsTrue this.ErrorsExist
67+
68+
[<Test>]
69+
member this.TwoClausesWithNullAndVariableShouldProduceError() =
70+
this.Parse """
71+
match foo with
72+
| null -> ()
73+
| notNullFoo -> () """
74+
75+
Assert.IsTrue this.ErrorsExist

0 commit comments

Comments
 (0)