From cab3bbc49dfd1b13b1f2971e785206e73dabc854 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Fri, 1 Mar 2024 17:01:10 -0600 Subject: [PATCH] remove the dummy test project files --- test/misc.fnl | 26 +++----- test/test-project/crash-files/test1.fnl | 7 -- test/test-project/crash-files/test2.fnl | 2 - test/test-project/file-with-compile-error.fnl | 6 -- test/test-project/goto-definition.fnl | 65 ------------------- 5 files changed, 8 insertions(+), 98 deletions(-) delete mode 100644 test/test-project/crash-files/test1.fnl delete mode 100644 test/test-project/crash-files/test2.fnl delete mode 100644 test/test-project/file-with-compile-error.fnl delete mode 100644 test/test-project/goto-definition.fnl diff --git a/test/misc.fnl b/test/misc.fnl index 346c452..6a7ee81 100644 --- a/test/misc.fnl +++ b/test/misc.fnl @@ -1,13 +1,10 @@ (local faith (require :faith)) (local fennel (require :fennel)) -(local {: create-client - : ROOT-URI} - (require :test.utils.client)) +(local {: create-client-with-files} (require :test.utils)) (local language (require :fennel-ls.language)) (local utils (require :fennel-ls.utils)) -(local filename (.. ROOT-URI "imaginary.fnl")) (fn test-multi-sym-split [] (faith.= ["foo"] (utils.multi-sym-split "foo" 2)) @@ -19,9 +16,8 @@ nil) (fn test-find-symbol [] - (let [state (doto (create-client) - (: :open-file! filename "(match [1 2 4] [1 2 sym-one] sym-one)")) - file (. state.server.files filename) + (let [{: self : uri} (create-client-with-files "(match [1 2 4] [1 2 sym-one] sym-one)") + file (. self.server.files uri) (symbol parents) (language.find-symbol file.ast 23)] (faith.= symbol (fennel.sym :sym-one)) (faith.= @@ -29,9 +25,8 @@ (fennel.view parents {:one-line? true}) "bad parents")) - (let [state (doto (create-client) - (: :open-file! filename "(match [1 2 4] [1 2 sym-one] sym-one)")) - file (. state.server.files filename) + (let [{: self : uri} (create-client-with-files "(match [1 2 4] [1 2 sym-one] sym-one)") + file (. self.server.files uri) (symbol parents) (language.find-symbol file.ast 18)] (faith.= symbol nil) (faith.= @@ -41,14 +36,9 @@ nil) (fn test-failure [] - (let [self (create-client) - state (require :fennel-ls.state) - searcher (require :fennel-ls.searcher)] - (faith.not= nil (searcher.lookup self.server :crash-files.test1)) - (faith.not= nil (state.get-by-module self.server :crash-files.test1))) - ;; TODO turn off TESTING=1 in makefile - ; (faith.not= nil (searcher.lookup self.server :crash-files.test2)) - ; (faith.not= nil (state.get-by-module self.server :crash-files.test2))) + (create-client-with-files "(macro foo {} nil) + (λ test {} nil) + (λ {} nil") nil) (fn test-split-spaces [] diff --git a/test/test-project/crash-files/test1.fnl b/test/test-project/crash-files/test1.fnl deleted file mode 100644 index 200bbf9..0000000 --- a/test/test-project/crash-files/test1.fnl +++ /dev/null @@ -1,7 +0,0 @@ -; things that caused fennel-ls to crash in the past -(macro foo {} nil) -(λ test {} nil) -(λ {} nil) -(fn foo.bar [] nil) - -nil diff --git a/test/test-project/crash-files/test2.fnl b/test/test-project/crash-files/test2.fnl deleted file mode 100644 index 28fffd0..0000000 --- a/test/test-project/crash-files/test2.fnl +++ /dev/null @@ -1,2 +0,0 @@ -;; fennel-ls: macro-file -(f) diff --git a/test/test-project/file-with-compile-error.fnl b/test/test-project/file-with-compile-error.fnl deleted file mode 100644 index d47fad1..0000000 --- a/test/test-project/file-with-compile-error.fnl +++ /dev/null @@ -1,6 +0,0 @@ -;; this file isn't used in any tests yet - -(let [foo true] - (an-unknown-mystery-global)) ;; the global should be an error, but ideally the compiler should keep going - -(do do) ;; this should be a compiler error, I don't mind if the compiler can't go past this one diff --git a/test/test-project/goto-definition.fnl b/test/test-project/goto-definition.fnl deleted file mode 100644 index 870534a..0000000 --- a/test/test-project/goto-definition.fnl +++ /dev/null @@ -1,65 +0,0 @@ -(local foo (require :foo)) -(require :bar) -(local {: bazfn} (require :baz)) - -(fn bar [a b] - (print a b) - (local c 10) - (foo.my-export c)) - -(bar 1 2) - -(print bazfn) - -(let [bar "shadowed"] - (print bar)) - -(fn test [{: foo}] - (let [a 10] - (match [0 10] - [1 a] a - [0 b] b)) - (print foo)) - -(fn b [] - (print "function")) - -(local obj {: bar :a b}) - -(obj.bar 2 3) -(obj:a) - -(local redefinition b) - -(local findme 10) -(local deep {:a {:b {:field findme}}}) -(local {:a {:b shallow}} deep) -(local mixed [{:key [5 {:foo shallow}]}]) -(local [{:key [_ {:foo funny}]}] mixed) -(print funny.field) - -(local findme 10) ;; via field access instead of destructure -(local deep {:a {:b {:field findme}}}) -(local shallow deep.a.b) -(local mixed [{:key [5 {:foo shallow}]}]) -(local funny (. mixed 1 :key 2 :foo)) -(print funny.field) - -(local object (do (let [a 10] {:my-definition :here}))) - -(local module {}) -(fn module.my-function [a b c] "docstring" (let [body (+ a b c)] body)) -(module.my-function 1 2 3) - -(local x {:y {:z (+ 1 1)}}) -(print x.y.z) - -(fn other [x] - (print x)) -(print x) - -(for [i 1 10] - (other i)) - -(each [k {: v} (pairs x)] - k v)