Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test
  • Loading branch information
auduchinok committed Nov 6, 2020
commit 3eca1d84fdebbeb76040171bd864092594aa4b8f
21 changes: 20 additions & 1 deletion tests/service/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ module Tests.Service.Symbols
#endif

open FSharp.Compiler.Service.Tests.Common
open FSharp.Compiler.SourceCodeServices
open FSharp.Compiler.SyntaxTree
open FsUnit
open NUnit.Framework
open FSharp.Compiler.SourceCodeServices

module ActivePatterns =

Expand Down Expand Up @@ -57,6 +58,24 @@ match "foo" with
getCaseUsages partialPatternInput 7 |> Array.head |> getGroupName |> shouldEqual "|String|_|"


module ExternDeclarations =
[<Test>]
let ``Access modifier`` () =
let parseResults, checkResults = getParseAndCheckResults "extern int private f()"

match parseResults.ParseTree with
| Some (ParsedInput.ImplFile (ParsedImplFileInput (modules = [SynModuleOrNamespace (decls = [decl])]))) ->
match decl with
| SynModuleDecl.Let (_, [Binding (accessibility = accessibility)], _) ->
accessibility |> should equal (Some SynAccess.Private)
| _ -> failwith "Couldn't get f"
| _ -> failwith "Couldn't get bindings"

match findSymbolByName "f" checkResults with
| :? FSharpMemberOrFunctionOrValue as mfv -> mfv.Accessibility.IsPrivate |> should equal true
| _ -> failwith "Couldn't get f"


module XmlDocSig =

[<Test>]
Expand Down