From e47ee5578464d2d8a4530506a9003de42ba91e1b Mon Sep 17 00:00:00 2001 From: XeroOl Date: Thu, 28 Mar 2024 22:38:01 -0500 Subject: [PATCH] shuffle around how encoding works in the tests --- test/rename.fnl | 7 +++---- test/utils/init.fnl | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/rename.fnl b/test/rename.fnl index 4fc8eca..6ff61c3 100644 --- a/test/rename.fnl +++ b/test/rename.fnl @@ -1,15 +1,14 @@ (local faith (require :faith)) -(local {: create-client-with-files - : default-encoding} (require :test.utils)) +(local {: create-client-with-files} (require :test.utils)) (local {: null} (require :fennel-ls.json.json)) (local {: apply-edits} (require :fennel-ls.utils)) (fn check [file-content new-name expected-file-content] - (let [{: self : uri : cursor : text} (create-client-with-files file-content) + (let [{: self : uri : cursor : text : encoding} (create-client-with-files file-content) [{: result}] (self:rename uri cursor new-name)] (if (= null result) (faith.= expected-file-content text) - (let [new-content (apply-edits text (. result.changes uri) default-encoding)] + (let [new-content (apply-edits text (. result.changes uri) encoding)] (faith.= expected-file-content new-content))))) (fn test-rename [] diff --git a/test/utils/init.fnl b/test/utils/init.fnl index f9ccbfa..48411b8 100644 --- a/test/utils/init.fnl +++ b/test/utils/init.fnl @@ -57,12 +57,12 @@ : cursor : locations : text - : uri})))) + : uri + :encoding self.server.position-encoding})))) (fn position-past-end-of-text [text ?encoding] (utils.byte->position text (+ (length text) 1) (or ?encoding default-encoding))) {: create-client-with-files : position-past-end-of-text - : default-encoding : get-markup}