Skip to content

Commit 43294db

Browse files
committed
Rename test helper
1 parent b36af24 commit 43294db

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/lsp4clj/server_test.clj

+11-11
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
(.toInstant java.time.ZoneOffset/UTC)
204204
(java.time.Clock/fixed (java.time.ZoneId/systemDefault))))
205205

206-
(defn trace-str [lines]
206+
(defn trace-log [lines]
207207
[:debug (string/join "\n" (into lines ["" "" ""]))])
208208

209209
(deftest should-trace-received-notifications
@@ -216,7 +216,7 @@
216216
trace-ch (:trace-ch server)]
217217
(server/start server nil)
218218
(async/put! input-ch (messages/request "foo" {:result "body"}))
219-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received notification 'foo'"
219+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received notification 'foo'"
220220
"Params: {"
221221
" \"result\" : \"body\""
222222
"}"])
@@ -233,12 +233,12 @@
233233
trace-ch (:trace-ch server)]
234234
(server/start server nil)
235235
(async/put! input-ch (messages/request 1 "foo" {:result "body"}))
236-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received request 'foo - (1)'"
236+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received request 'foo - (1)'"
237237
"Params: {"
238238
" \"result\" : \"body\""
239239
"}"])
240240
(h/assert-take trace-ch)))
241-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Sending response 'foo - (1)'. Request took 0ms. Request failed: Method not found (-32601)."
241+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Sending response 'foo - (1)'. Request took 0ms. Request failed: Method not found (-32601)."
242242
"Error data: {"
243243
" \"method\" : \"foo\""
244244
"}"])
@@ -256,13 +256,13 @@
256256
_ (server/start server nil)
257257
_ (server/send-request server "req" {:body "foo"})
258258
client-rcvd-msg (h/assert-take output-ch)]
259-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Sending request 'req - (1)'"
259+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Sending request 'req - (1)'"
260260
"Params: {"
261261
" \"body\" : \"foo\""
262262
"}"])
263263
(h/assert-take trace-ch)))
264264
(async/put! input-ch (messages/response (:id client-rcvd-msg) {:processed true}))
265-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received response 'req - (1)'. Request took 0ms."
265+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received response 'req - (1)'. Request took 0ms."
266266
"Result: {"
267267
" \"processed\" : true"
268268
"}"])
@@ -280,15 +280,15 @@
280280
_ (server/start server nil)
281281
_ (server/send-request server "req" {:body "foo"})
282282
client-rcvd-msg (h/assert-take output-ch)]
283-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Sending request 'req - (1)'"
283+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Sending request 'req - (1)'"
284284
"Params: {"
285285
" \"body\" : \"foo\""
286286
"}"])
287287
(h/assert-take trace-ch)))
288288
(async/put! input-ch
289289
(messages/response (:id client-rcvd-msg)
290290
{:error {:code 1234 :message "Something bad" :data {:body "foo"}}}))
291-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received response 'req - (1)'. Request took 0ms. Request failed: Something bad (1234)."
291+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received response 'req - (1)'. Request took 0ms. Request failed: Something bad (1234)."
292292
"Error data: {"
293293
" \"body\" : \"foo\""
294294
"}"])
@@ -305,7 +305,7 @@
305305
trace-ch (:trace-ch server)]
306306
(server/start server nil)
307307
(async/put! input-ch (messages/response 100 {:processed true}))
308-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received response for unmatched request:"
308+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received response for unmatched request:"
309309
"Body: {"
310310
" \"jsonrpc\" : \"2.0\","
311311
" \"id\" : 100,"
@@ -326,7 +326,7 @@
326326
trace-ch (:trace-ch server)]
327327
(server/start server nil)
328328
(server/send-notification server "req" {:body "foo"})
329-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Sending notification 'req'"
329+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Sending notification 'req'"
330330
"Params: {"
331331
" \"body\" : \"foo\""
332332
"}"])
@@ -432,7 +432,7 @@
432432
:clock fixed-clock})]
433433
(server/start server nil)
434434
(async/put! input-ch (messages/request "foo" {:result "body"}))
435-
(is (= (trace-str ["[Trace - 2022-03-05T13:35:23Z] Received notification 'foo'"
435+
(is (= (trace-log ["[Trace - 2022-03-05T13:35:23Z] Received notification 'foo'"
436436
"Params: {"
437437
" \"result\" : \"body\""
438438
"}"])

0 commit comments

Comments
 (0)