Skip to content

Commit 0228ded

Browse files
committed
FavourStaticEmptyFields: added more tests
1 parent a69764d commit 0228ded

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ let foo =
129129
Assert.IsTrue this.ErrorsExist
130130
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
131131

132+
[<Test>]
133+
member this.FavourStaticEmptyFieldsShouldProduceError14() =
134+
this.Parse """
135+
let foo =
136+
{
137+
Bar = ("a", "")
138+
}"""
139+
140+
Assert.IsTrue this.ErrorsExist
141+
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
142+
143+
[<Test>]
144+
member this.FavourStaticEmptyFieldsShouldProduceError15() =
145+
this.Parse """
146+
foo.[""] <- 0"""
147+
148+
Assert.IsTrue this.ErrorsExist
149+
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
150+
132151
[<Test>]
133152
member this.FavourStaticEmptyFieldsShouldNotProduceError1() =
134153
this.Parse "let bar = String.Empty"

0 commit comments

Comments
 (0)