|
1 | 1 | #lang racket/base |
2 | 2 |
|
3 | 3 | (require "../client.rkt" |
4 | | - "../../json-util.rkt" |
5 | | - chk) |
| 4 | + "../../json-util.rkt") |
6 | 5 |
|
7 | 6 | (module+ test |
8 | 7 | (require rackunit |
|
22 | 21 | 'text "#lang racke")))) |
23 | 22 | ;; should report "collection not found" diagnostic error |
24 | 23 | (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"))))) |
36 | 34 |
|
37 | 35 |
|
38 | 36 | (define didchange-req |
|
44 | 42 | (list (hasheq 'text "#lang racket"))))) |
45 | 43 | ;; should not report any error |
46 | 44 | (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))))) |
51 | 48 |
|
52 | 49 |
|
53 | 50 | ;; no response for didClose request |
|
0 commit comments