1+ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
13namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn
24
35open System.IO
4- open FSharp.Compiler .CodeAnalysis
5- open Microsoft.CodeAnalysis
6- open Microsoft.CodeAnalysis .Text
76open Microsoft.VisualStudio .FSharp .Editor
87open NUnit.Framework
9- open UnitTests.TestLib .LanguageService
108open VisualFSharp.UnitTests .Roslyn
119
1210[<Category " Roslyn Services" >]
@@ -45,7 +43,6 @@ let GetQuickInfoTextFromCode (code:string) =
4543
4644let expectedLines ( lines : string list ) = System.String.Join( " \n " , lines)
4745
48- // migrated from legacy test
4946[<Test>]
5047let ``Automation.EnumDUInterfacefromFSBrowse.InsideComputationExpression`` () =
5148 let code = """
@@ -70,7 +67,6 @@ module Test =
7067 let expected = " MyColors.Red: MyColors = 0"
7168 Assert.AreEqual( expected, quickInfo)
7269
73- // migrated from legacy test
7470[<Test>]
7571let ``Automation.EnumDUInterfacefromFSBrowse.InsideMatch`` () =
7672 let code = """
@@ -100,7 +96,6 @@ module Test =
10096 " Full name: FsTest.MyDistance" ]
10197 Assert.AreEqual( expected, quickInfo)
10298
103- // migrated from legacy test
10499[<Test>]
105100let ``Automation.EnumDUInterfacefromFSBrowse.InsideLambda`` () =
106101 let code = """
@@ -129,7 +124,6 @@ module Test =
129124 let expected = " abstract IMyInterface.Represent: unit -> string"
130125 Assert.AreEqual( expected, quickInfo)
131126
132- // migrated from legacy test
133127[<Test>]
134128let ``Automation.RecordAndInterfaceFromFSProj.InsideComputationExpression`` () =
135129 let code = """
@@ -162,7 +156,6 @@ module Test =
162156 Assert.AreEqual( expected, quickInfo)
163157 ()
164158
165- // migrated from legacy test
166159[<Test>]
167160let ``Automation.RecordAndInterfaceFromFSProj.InsideQuotation`` () =
168161 let code = """
@@ -186,7 +179,6 @@ module Test =
186179 Assert.AreEqual( expected, quickInfo)
187180 ()
188181
189- // migrated from legacy test
190182[<Test>]
191183let ``Automation.RecordAndInterfaceFromFSProj.InsideLambda`` () =
192184 let code = """
@@ -212,7 +204,6 @@ module Test =
212204 Assert.AreEqual( expected, quickInfo)
213205 ()
214206
215- // migrated from legacy test
216207[<Test>]
217208let ``Automation.TupleRecordFromFSBrowse.InsideComputationExpression`` () =
218209 let code = """
@@ -237,7 +228,6 @@ module Test =
237228 Assert.AreEqual( expected, quickInfo)
238229 ()
239230
240- // migrated from legacy test
241231[<Test>]
242232let ``Automation.TupleRecordFromFSBrowse.SequenceOfMethods`` () =
243233 let code = """
@@ -266,7 +256,6 @@ module Test =
266256 Assert.AreEqual( expected, quickInfo)
267257 ()
268258
269- // migrated from legacy test
270259[<Test>]
271260let ``Automation.UnionAndStructFromFSProj.MatchExpression`` () =
272261 let code = """
@@ -289,7 +278,6 @@ module Test =
289278 Assert.AreEqual( expected, quickInfo)
290279 ()
291280
292- // migrated from legacy test
293281[<Test>]
294282let ``Automation.UnionAndStructFromFSProj.MatchPattern`` () =
295283 let code = """
@@ -312,7 +300,6 @@ module Test =
312300 Assert.AreEqual( expected, quickInfo)
313301 ()
314302
315- // migrated from legacy test
316303[<Test>]
317304let ``Automation.UnionAndStructFromFSProj.UnionIfPredicate`` () =
318305 let code = """
@@ -334,7 +321,6 @@ module Test =
334321 Assert.AreEqual( expected, quickInfo)
335322 ()
336323
337- // migrated from legacy test
338324[<Test>]
339325let ``Automation.UnionAndStructFromFSProj.UnionForPattern`` () =
340326 let code = """
@@ -356,7 +342,6 @@ module Test =
356342 Assert.AreEqual( expected, quickInfo)
357343 ()
358344
359- // migrated from legacy test
360345[<Test>]
361346let ``Automation.UnionAndStructFromFSProj.UnionMethodPatternMatch`` () =
362347 let code = """
@@ -386,7 +371,6 @@ module Test =
386371 Assert.AreEqual( expected, quickInfo)
387372 ()
388373
389- // migrated from legacy test
390374[<Test>]
391375let ``Automation.UnionAndStructFromFSProj.UnionMethodPatternMatchBody`` () =
392376 let code = """
@@ -414,7 +398,6 @@ module Test =
414398 Assert.AreEqual( expected, quickInfo)
415399 ()
416400
417- // migrated from legacy test
418401[<Test>]
419402let ``Automation.UnionAndStructFromFSProj.UnionPropertyInComputationExpression`` () =
420403 let code = """
@@ -444,3 +427,35 @@ module Test =
444427 let expected = " property MyDistance.asNautical: MyDistance with get"
445428 Assert.AreEqual( expected, quickInfo)
446429 ()
430+
431+ [<Test>]
432+ let ``Automation.LetBindings.InsideModule`` () =
433+ let code = """
434+ namespace FsTest
435+
436+ module Test =
437+ let fu$$nc x = ()
438+ """
439+ let expectedSignature = " val func: x: 'a -> unit"
440+
441+ let tooltip = GetQuickInfoTextFromCode code
442+
443+ StringAssert.StartsWith( expectedSignature, tooltip)
444+ ()
445+
446+ [<Test>]
447+ let ``Automation.LetBindings.InsideType`` () =
448+ let code = """
449+ namespace FsTest
450+
451+ module Test =
452+ type T() =
453+ let fu$$nc x = ()
454+ """
455+
456+ let expectedSignature = " val func: x: 'a -> unit"
457+
458+ let tooltip = GetQuickInfoTextFromCode code
459+
460+ StringAssert.StartsWith( expectedSignature, tooltip)
461+ ()
0 commit comments