remove the dummy test project files
This commit is contained in:
parent
25375715c7
commit
cab3bbc49d
@ -1,13 +1,10 @@
|
|||||||
(local faith (require :faith))
|
(local faith (require :faith))
|
||||||
(local fennel (require :fennel))
|
(local fennel (require :fennel))
|
||||||
(local {: create-client
|
(local {: create-client-with-files} (require :test.utils))
|
||||||
: ROOT-URI}
|
|
||||||
(require :test.utils.client))
|
|
||||||
|
|
||||||
(local language (require :fennel-ls.language))
|
(local language (require :fennel-ls.language))
|
||||||
(local utils (require :fennel-ls.utils))
|
(local utils (require :fennel-ls.utils))
|
||||||
|
|
||||||
(local filename (.. ROOT-URI "imaginary.fnl"))
|
|
||||||
|
|
||||||
(fn test-multi-sym-split []
|
(fn test-multi-sym-split []
|
||||||
(faith.= ["foo"] (utils.multi-sym-split "foo" 2))
|
(faith.= ["foo"] (utils.multi-sym-split "foo" 2))
|
||||||
@ -19,9 +16,8 @@
|
|||||||
nil)
|
nil)
|
||||||
|
|
||||||
(fn test-find-symbol []
|
(fn test-find-symbol []
|
||||||
(let [state (doto (create-client)
|
(let [{: self : uri} (create-client-with-files "(match [1 2 4] [1 2 sym-one] sym-one)")
|
||||||
(: :open-file! filename "(match [1 2 4] [1 2 sym-one] sym-one)"))
|
file (. self.server.files uri)
|
||||||
file (. state.server.files filename)
|
|
||||||
(symbol parents) (language.find-symbol file.ast 23)]
|
(symbol parents) (language.find-symbol file.ast 23)]
|
||||||
(faith.= symbol (fennel.sym :sym-one))
|
(faith.= symbol (fennel.sym :sym-one))
|
||||||
(faith.=
|
(faith.=
|
||||||
@ -29,9 +25,8 @@
|
|||||||
(fennel.view parents {:one-line? true})
|
(fennel.view parents {:one-line? true})
|
||||||
"bad parents"))
|
"bad parents"))
|
||||||
|
|
||||||
(let [state (doto (create-client)
|
(let [{: self : uri} (create-client-with-files "(match [1 2 4] [1 2 sym-one] sym-one)")
|
||||||
(: :open-file! filename "(match [1 2 4] [1 2 sym-one] sym-one)"))
|
file (. self.server.files uri)
|
||||||
file (. state.server.files filename)
|
|
||||||
(symbol parents) (language.find-symbol file.ast 18)]
|
(symbol parents) (language.find-symbol file.ast 18)]
|
||||||
(faith.= symbol nil)
|
(faith.= symbol nil)
|
||||||
(faith.=
|
(faith.=
|
||||||
@ -41,14 +36,9 @@
|
|||||||
nil)
|
nil)
|
||||||
|
|
||||||
(fn test-failure []
|
(fn test-failure []
|
||||||
(let [self (create-client)
|
(create-client-with-files "(macro foo {} nil)
|
||||||
state (require :fennel-ls.state)
|
(λ test {} nil)
|
||||||
searcher (require :fennel-ls.searcher)]
|
(λ {} nil")
|
||||||
(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)))
|
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
(fn test-split-spaces []
|
(fn test-split-spaces []
|
||||||
|
|||||||
@ -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
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
;; fennel-ls: macro-file
|
|
||||||
(f)
|
|
||||||
@ -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
|
|
||||||
@ -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)
|
|
||||||
Loading…
Reference in New Issue
Block a user