Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 856c113

Browse files
committed
Now tests for jsonrpc == 2.0
1 parent 00f4dc4 commit 856c113

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test-main.rkt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
"../msg-io.rkt")
55

66
(define init-msg
7-
(hasheq 'id 0
7+
(hasheq 'jsonrpc "2.0"
8+
'id 0
89
'method "initialize"
910
'params (hasheq 'processId (getpid)
1011
'rootPath "/home/conor/racket-langserver/"
1112
'rootUri "file:///home/conor/racket-langserver/"
1213
'capabilities (hasheq))))
1314

1415
(define shutdown-msg
15-
(hasheq 'id 1
16+
(hasheq 'jsonrpc "2.0"
17+
'id 1
1618
'method "shutdown"))
1719

1820
(define exit-notf
19-
(hasheq 'method "exit"))
21+
(hasheq 'jsonrpc "2.0"
22+
'method "exit"))
2023

2124
(define ((forward-errors in))
2225
(for ([str (in-port read-line in)])
@@ -31,12 +34,14 @@
3134
(display-message/flush init-msg stdin)
3235
(let ([resp (read-message stdout)])
3336
(chk*
37+
(chk #:= (hash-ref resp 'jsonrpc) "2.0")
3438
(chk #:= (hash-ref init-msg 'id) (hash-ref resp 'id))
3539
(chk (not (hash-ref resp 'error #f)))))
3640
;; Shutdown request
3741
(display-message/flush shutdown-msg stdin)
3842
(let ([resp (read-message stdout)])
3943
(chk*
44+
(chk #:= (hash-ref resp 'jsonrpc) "2.0")
4045
(chk #:= (hash-ref shutdown-msg 'id) (hash-ref resp 'id))
4146
(chk (not (hash-ref resp 'error #f)))))
4247
;; Exit

0 commit comments

Comments
 (0)