Skip to content

Commit 29acd7d

Browse files
committed
sync test need to follow 7281878
1 parent 81cd443 commit 29acd7d

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

tests/sync/test.rkt

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#lang racket/base
22

33
(require "../client.rkt"
4-
"../../json-util.rkt"
5-
chk)
4+
"../../json-util.rkt")
65

76
(module+ test
87
(require rackunit
@@ -22,17 +21,16 @@
2221
'text "#lang racke"))))
2322
;; should report "collection not found" diagnostic error
2423
(client-send lsp didopen-req)
25-
(let ([resp (client-wait-response lsp)])
26-
(chk*
27-
(chk (jsexpr-has-key? resp '(params diagnostics)))
28-
(define diagnostics-msg (jsexpr-ref resp '(params diagnostics)))
29-
(check-false (null? diagnostics-msg))
30-
(define dm (with-input-from-string
31-
(jsexpr->string (car diagnostics-msg))
32-
(lambda () (read-json))))
33-
(define resp-no-message (hash-remove dm 'message))
34-
(check-equal? (jsexpr->string resp-no-message)
35-
(jsexpr->string (read-json (open-input-file "diagnostics.json"))))))
24+
(let ([resp (client-wait-notification lsp)])
25+
(check-true (jsexpr-has-key? resp '(params diagnostics)))
26+
(define diagnostics-msg (jsexpr-ref resp '(params diagnostics)))
27+
(check-false (null? diagnostics-msg))
28+
(define dm (with-input-from-string
29+
(jsexpr->string (car diagnostics-msg))
30+
(lambda () (read-json))))
31+
(define resp-no-message (hash-remove dm 'message))
32+
(check-equal? (jsexpr->string resp-no-message)
33+
(jsexpr->string (read-json (open-input-file "diagnostics.json")))))
3634

3735

3836
(define didchange-req
@@ -44,10 +42,9 @@
4442
(list (hasheq 'text "#lang racket")))))
4543
;; should not report any error
4644
(client-send lsp didchange-req)
47-
(let ([resp (client-wait-response lsp)])
48-
(chk*
49-
(chk (jsexpr-has-key? resp '(params diagnostics)))
50-
(chk (null? (jsexpr-ref resp '(params diagnostics))))))
45+
(let ([resp (client-wait-notification lsp)])
46+
(check-true (jsexpr-has-key? resp '(params diagnostics)))
47+
(check-true (null? (jsexpr-ref resp '(params diagnostics)))))
5148

5249

5350
;; no response for didClose request

0 commit comments

Comments
 (0)