Skip to content

Commit d39d5d5

Browse files
yuhan0bbatsov
authored andcommitted
Fix bug when renaming ns aliases with common prefixes
1 parent 7b1e9a2 commit d39d5d5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

clojure-mode-refactor-rename-ns-alias-test.el

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@
4343
(+ (foo/a 1) (b 2))"
4444

4545
(clojure--rename-ns-alias-internal "lib" "foo"))
46+
(when-refactoring-it "should handle multiple aliases with common prefixes"
47+
48+
"(ns foo
49+
(:require [clojure.string :as string]
50+
[clojure.spec.alpha :as s]
51+
[clojure.java.shell :as shell]))
52+
53+
(s/def ::abc string/blank?)
54+
"
55+
"(ns foo
56+
(:require [clojure.string :as string]
57+
[clojure.spec.alpha :as spec]
58+
[clojure.java.shell :as shell]))
59+
60+
(spec/def ::abc string/blank?)
61+
"
62+
(clojure--rename-ns-alias-internal "s" "spec"))
4663

4764
(when-refactoring-it "should handle ns declarations with missing as"
4865
"(ns cljr.core

0 commit comments

Comments
 (0)