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}