Skip to content

Commit 2c590fa

Browse files
committed
Core.Tests: added tests for rule 77
Added test cases for using pipe operator on function with 2 arguments.
1 parent d703c55 commit 2c590fa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,24 @@ module Foo
199199
"""
200200

201201
Assert.IsTrue this.NoErrorsExist
202+
203+
[<Test>]
204+
member this.``Use pipe operator for function with more than 1 argument``() =
205+
this.Parse """
206+
let someFunc someParam =
207+
someParam
208+
|> someOtherFunc someOtherParam
209+
"""
210+
211+
Assert.IsTrue this.NoErrorsExist
212+
213+
[<Test>]
214+
member this.``Use pipe operator for higher-order function with more than 1 argument``() =
215+
this.Parse """
216+
parsedSolution.ProjectsInOrder
217+
|> Seq.map(fun proj ->
218+
proj.AbsolutePath |> normalizeDirSeparatorsPaths |> FileInfo
219+
)
220+
"""
221+
222+
Assert.IsTrue this.NoErrorsExist

0 commit comments

Comments
 (0)