File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 8989 (with-clojure-buffer (concat form some-sexp)
9090 (end-of-buffer )
9191 (clojure-match-next-def)
92- (expect (looking-at " (def" )))))))
92+ (expect (looking-at " (def" ))))))
93+
94+ (it " captures var name"
95+ (let ((var-name " some-name" ))
96+ (dolist (form '(" (def %s 1)"
97+ " (def %s)"
98+ " (def ^:private %s 2)"
99+ " (def ^{:private true} %s 3)" ))
100+ (with-clojure-buffer (format form var-name)
101+ (end-of-buffer )
102+ (clojure-match-next-def)
103+ (cl-destructuring-bind (name-beg name-end) (match-data )
104+ (expect (string= var-name (buffer-substring name-beg name-end))))))))
105+
106+ (it " captures var name with dispatch value for defmethod"
107+ (let ((name " some-name :key" ))
108+ (dolist (form '(" (defmethod %s [a])"
109+ " (defmethod ^:meta %s [a])"
110+ " (defmethod ^{:meta true} %s [a])"
111+ " (defmethod %s)" ))
112+ (with-clojure-buffer (format form name)
113+ (end-of-buffer )
114+ (clojure-match-next-def)
115+ (cl-destructuring-bind (name-beg name-end) (match-data )
116+ (expect (string= name (buffer-substring name-beg name-end)))))))))
93117
94118(describe " clojure syntax"
95119 (it " handles prefixed symbols"
You can’t perform that action at this time.
0 commit comments