Skip to content

Commit

Permalink
Extra tests for type hints (#14552)
Browse files Browse the repository at this point in the history
  • Loading branch information
psfinaki authored Jan 9, 2023
1 parent 71cabf4 commit 24291f2
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type Song() as x =
Assert.IsEmpty(result)

[<Test>]
let ``Hints are shown for lambdas`` () =
let ``Hints are shown within lambdas`` () =
let code =
"""
let iamboring() =
Expand All @@ -162,7 +162,7 @@ let iamboring() =
Assert.AreEqual(expected, actual)

[<Test>]
let ``Hints are shown for lambdas with tuples`` () =
let ``Hints are shown within lambdas with tuples`` () =
let code =
"""
let zip4 (l1: 'a list) (l2: 'b list) (l3: 'c list) (l4: 'd list) =
Expand All @@ -184,6 +184,19 @@ let zip4 (l1: 'a list) (l2: 'b list) (l3: 'c list) (l4: 'd list) =

CollectionAssert.AreEquivalent(expected, actual)

[<Test>]
let ``Hints are not shown for lambda return types`` () =
let code =
"""
let func = fun () -> 3
"""

let document = getFsDocument code

let result = getTypeHints document

Assert.IsEmpty(result)

[<Test>]
let ``Hints are not shown for unfinished expressions`` () =
let code =
Expand Down Expand Up @@ -248,7 +261,6 @@ type Number<'T when IAddition<'T>>(value: 'T) =

CollectionAssert.AreEquivalent(expected, actual)


[<Test>]
let ``Hints are not shown when type is specified`` () =
let code =
Expand All @@ -264,4 +276,4 @@ type MyType() =

let result = getTypeHints document

Assert.IsEmpty(result)
Assert.IsEmpty(result)

0 comments on commit 24291f2

Please sign in to comment.