Skip to content

Commit 2b1cb8f

Browse files
committed
PublicValuesNames: add test for nested function
Which tests for the fact that the rule should not fire for nested functions because they are not public.
1 parent 9bec3ed commit 2b1cb8f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/FSharpLint.Core.Tests/Rules/Conventions/Naming/PublicValuesNames.fs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,23 @@ let (|Empty|_|) str =
9494
"""
9595

9696
this.AssertNoWarnings()
97+
98+
let pascalCaseConfig = { config with Naming = Some NamingCase.PascalCase }
99+
100+
[<TestFixture>]
101+
type TestConventionsPublicValuesNamesPascalCase() =
102+
inherit TestAstNodeRuleBase.TestAstNodeRuleBase(PublicValuesNames.rule pascalCaseConfig)
103+
104+
[<Test>]
105+
member this.``Nested function should not generate warning``() =
106+
this.Parse """
107+
module Program
108+
109+
[ "one" ]
110+
|> Seq.iter (fun str ->
111+
let someFunc bar = bar
112+
someFunc str
113+
)
114+
"""
115+
116+
this.AssertNoWarnings()

0 commit comments

Comments
 (0)