File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 6060 (expect (non-func " ^hint " form) :to-be nil )
6161 (expect (non-func " #macro " form) :to-be nil ))))
6262
63+ (describe " clojure-match-next-def"
64+ (let ((some-sexp " \n (list [1 2 3])" ))
65+ (it " handles vars with metadata"
66+ (dolist (form '(" (def ^Integer a 1)"
67+ " (def ^:a a 1)"
68+ " (def ^::a a 1)"
69+ " (def ^::a/b a 1)"
70+ " (def ^{:macro true} a 1)" ))
71+ (with-clojure-buffer (concat form some-sexp)
72+ (end-of-buffer )
73+ (clojure-match-next-def)
74+ (expect (looking-at " (def" )))))
75+
76+ (it " handles vars without metadata"
77+ (with-clojure-buffer (concat " (def a 1)" some-sexp)
78+ (end-of-buffer )
79+ (clojure-match-next-def)
80+ (expect (looking-at " (def" ))))
81+
82+ (it " handles invalid def forms"
83+ (dolist (form '(" (def ^Integer)"
84+ " (def)"
85+ " (def ^{:macro})"
86+ " (def ^{:macro true})"
87+ " (def ^{:macro true} foo)"
88+ " (def ^{:macro} foo)" ))
89+ (with-clojure-buffer (concat form some-sexp)
90+ (end-of-buffer )
91+ (clojure-match-next-def)
92+ (expect (looking-at " (def" )))))))
93+
6394(describe " clojure syntax"
6495 (it " handles prefixed symbols"
6596 (dolist (form '((" #?@aaa" . " aaa" )
You can’t perform that action at this time.
0 commit comments