Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clojure-sort-ns with comments in the end #646

Merged
merged 6 commits into from
Jun 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more tests for clojure-sort-ns
p4v4n committed Jun 24, 2023
commit 4c81348628d9089b47fe870ab2efb9c777582b01
25 changes: 25 additions & 0 deletions test/clojure-mode-util-test.el
Original file line number Diff line number Diff line change
@@ -149,6 +149,31 @@
(:require [my-app.views [user-page :as user-page]]
[rum.core :as rum] ;comment\n
;;[comment2]\n))")))
(it "should sort requires in ns with copyright disclamer and comments"
(with-clojure-buffer ";; Copyright (c) John Doe. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
(ns clojure.core
(:require
;; The first comment
[foo] ;; foo comment
;; Middle comment
[bar] ;; bar comment
;; A last comment
))"
(clojure-sort-ns)
(expect (buffer-string) :to-equal
";; Copyright (c) John Doe. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
(ns clojure.core
(:require
;; Middle comment
[bar] ;; bar comment
;; The first comment
[foo] ;; foo comment\n
;; A last comment
))")))

(it "should also sort imports in a ns"
(with-clojure-buffer "\n(ns my-app.core