FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShellEditorServices/test/emacs-simple-test.el at main · PowerShell/PowerShellEditorServices · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
PowerShell
/
PowerShellEditorServices
Public
Notifications
You must be signed in to change notification settings
Fork
264
Star
764
Code
Issues
125
Pull requests
18
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
PowerShellEditorServices
/
test
/
emacs-simple-test.el
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (51 loc) · 2.05 KB
Breadcrumbs
PowerShellEditorServices
/
test
/
emacs-simple-test.el
Copy path
File metadata and controls
63 lines (51 loc) · 2.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;
;; emacs-simple-test.el --- Integration testing script -*-
lexical-binding
:
t
; -*-
;
; Copyright (c) Microsoft Corporation.
;
; Licensed under the MIT License.
;
; Author: Andy Jordan <andy.jordan@microsoft.com>
;
; Keywords: PowerShell, LSP
;
;; Code:
;
; Avoid using old packages.
(
setq
load-prefer-newer
t
)
;
; Improved TLS Security.
(
with-eval-after-load
'gnutls
(
custom-set-variables
'(gnutls-verify-error
t
)
'(gnutls-min-prime-bits
3072
)))
;
; Package setup.
(
require
'package
)
(
add-to-list
'package-archives
'(
"
melpa
"
.
"
https://melpa.org/packages/
"
)
t
)
(
package-initialize
)
(
package-refresh-contents
)
(
require
'ert
)
(
require
'flymake
)
(
unless
(
package-installed-p
'powershell
)
(
package-install
'powershell
))
(
require
'powershell
)
(
unless
(
package-installed-p
'eglot
)
(
package-install
'eglot
))
(
require
'eglot
)
(
ert-deftest
powershell-editor-services ()
"
Eglot should connect to PowerShell Editor Services.
"
(
let*
((repo (project-root (
project-current
)))
(start-script (
expand-file-name
"
module/PowerShellEditorServices/Start-EditorServices.ps1
"
repo))
(test-script (
expand-file-name
"
test/PowerShellEditorServices.Test.Shared/Debugging/VariableTest.ps1
"
repo))
(eglot-sync-connect
t
))
(
add-to-list
'eglot-server-programs
`(
powershell-mode
.
(
"
pwsh
"
"
-NoLogo
"
"
-NoProfile
"
"
-Command
"
,start-script
"
-Stdio
"
)))
(
with-current-buffer
(
find-file-noselect
test-script)
(
should
(
eq
major-mode
'powershell-mode
))
(
should
(
apply
#
'eglot--connect
(eglot--guess-contact)))
(
should
(eglot-current-server))
(
let
((lsp (eglot-current-server)))
(
should
(
string=
(eglot--project-nickname lsp)
"
PowerShellEditorServices
"
))
(
should
(
member
(
cons
'powershell-mode
"
powershell
"
) (eglot--languages lsp))))
(
sleep-for
5
)
;
TODO: Wait for "textDocument/publishDiagnostics" instead
(flymake-start)
(
goto-char
(
point-min
))
(
flymake-goto-next-error
)
(
should
(
eq
'flymake-warning
(
face-at-point
))))))
(
provide
'emacs-test
)
;
;; emacs-test.el ends here
Back
|
FazBrowse Home
|
New Git URL