Skip to content

Commit 3513d32

Browse files
janusknocte
authored andcommitted
RedundantNewKeyword: add more unit test
Related to #555.
1 parent 9f198b6 commit 3513d32

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,31 @@ module Program
3838
let _ = System.Version()"""
3939

4040
this.Parse source
41-
Assert.AreEqual(expected, this.ApplyQuickFix source)
41+
Assert.AreEqual(expected, this.ApplyQuickFix source)
42+
43+
[<Test>]
44+
member this.``new keyword is not required (1).``() =
45+
this.Parse("""
46+
module Program
47+
let foo =
48+
new System.Collections.Generic.Dictionary<string, string>() |> ignore""")
49+
50+
Assert.IsTrue this.ErrorsExist
51+
52+
[<Test>]
53+
member this.``new keyword is not required (2).``() =
54+
this.Parse("""
55+
module Program
56+
let foo =
57+
new Guid() |> ignore""")
58+
59+
Assert.IsTrue this.ErrorsExist
60+
61+
[<Test>]
62+
member this.``new keyword is not required (3).``() =
63+
this.Parse("""
64+
module Program
65+
let foo =
66+
new Int32() |> ignore""")
67+
68+
Assert.IsTrue this.ErrorsExist

0 commit comments

Comments
 (0)