Skip to content

Commit 2821485

Browse files
committed
Tests(Core): test for MaxLinesInFunction for nested functions
Added a new test case that makes sure a too long nested function triggers violations.
1 parent 4f33206 commit 2821485

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ let dog x =
105105
()""")
106106
Assert.IsFalse this.ErrorsExist
107107

108+
[<Test>]
109+
member this.NestedFunctionWithTooManyLines() =
110+
this.Parse($"""
111+
module Program
112+
113+
let dog x =
114+
let foo y =
115+
%s{generateNewLines FunctionLength 8}
116+
()
117+
()""")
118+
Assert.IsTrue this.ErrorsExist
119+
108120
[<Literal>]
109121
let LambdaFunctionLength = 5
110122
[<TestFixture>]

0 commit comments

Comments
 (0)