Skip to content

Commit

Permalink
Fix clojure-find-ns for ns forms preceded by whitespace (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
p4v4n authored and vemv committed Sep 7, 2023
1 parent 2f834cc commit 788cc5a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions clojure-mode-util-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@
(expect (clojure-find-ns) :to-equal "foo"))
(with-clojure-buffer "(ns ^:bar ^:baz foo)"
(expect (clojure-find-ns) :to-equal "foo")))
(it "should find namespaces with spaces before ns form"
(with-clojure-buffer " (ns foo)"
(expect (clojure-find-ns) :to-equal "foo")))
(it "should skip namespaces within any comment forms"
(with-clojure-buffer "(comment
(ns foo))"
(expect (clojure-find-ns) :to-equal nil))
(with-clojure-buffer " (ns foo)
(comment
(ns bar))"
(expect (clojure-find-ns) :to-equal "foo"))
(with-clojure-buffer " (comment
(ns foo))
(ns bar)
(comment
(ns baz))"
(expect (clojure-find-ns) :to-equal "bar")))
(it "should find namespace declarations with nested metadata and docstrings"
(with-clojure-buffer "(ns ^{:bar true} foo)"
(expect (clojure-find-ns) :to-equal "foo"))
Expand Down

0 comments on commit 788cc5a

Please sign in to comment.