Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dawedawe committed Nov 28, 2023
1 parent 2080072 commit 357635e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
23 changes: 22 additions & 1 deletion test/FsAutoComplete.Tests.Lsp/CoreTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,28 @@ let tooltipTests state =
" body : (MailboxProcessor<string> -> Async<unit>) *"
" cancellationToken: option<System.Threading.CancellationToken>"
" -> MailboxProcessor<string>" ])
verifySignature 54 9 "Case2 of string * newlineBefore: bool * newlineAfter: bool" ] ]
verifySignature 54 9 "Case2 of string * newlineBefore: bool * newlineAfter: bool"
verifySignature
60
7
(concatLines
[ "active pattern Value: "
" input: Expr"
" -> option<obj * System.Type>" ])
verifySignature
65
7
(concatLines
[ "active pattern DefaultValue: "
" input: Expr"
" -> option<System.Type>" ])
verifySignature
70
7
(concatLines
[ "active pattern ValueWithName: "
" input: Expr"
" -> option<obj * System.Type * string>" ]) ] ]

let closeTests state =
// Note: clear diagnostics also implies clear caches (-> remove file & project options from State).
Expand Down
17 changes: 17 additions & 0 deletions test/FsAutoComplete.Tests.Lsp/TestCases/Tooltips/Script.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,20 @@ let mailbox =
type DiscUnionWithCaseOfLabeledTuple =
| Case1
| Case2 of string * newlineBefore: bool * newlineAfter: bool

open FSharp.Quotations.Patterns

let testActivePatternSignatureWithSubStringName (expr: Quotations.Expr) =
match expr with
| Value (o, t) -> (o, t)
| _ -> failwith "no value match"
|> ignore

match expr with
| DefaultValue t -> t
| _ -> failwith "no value match"
|> ignore

match expr with
| ValueWithName t -> t
| _ -> failwith "no value match"

0 comments on commit 357635e

Please sign in to comment.