Skip to content

Commit 98b805b

Browse files
committed
Fix and cover project-files-in-topo-order
1 parent 40ee1de commit 98b805b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
VERSION ?= 1.10
44

55
.inline-deps:
6+
git clean -fdx
67
lein with-profile -user,+$(VERSION) inline-deps
78
touch .inline-deps
89

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject refactor-nrepl "3.0.0-alpha4"
1+
(defproject refactor-nrepl "3.0.0-alpha10"
22
:description "nREPL middleware to support editor-agnostic refactoring"
33
:url "http://github.com/clojure-emacs/refactor-nrepl"
44
:license {:name "Eclipse Public License"

src/refactor_nrepl/ns/tracker.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[clojure.tools.namespace
55
[dependency :as dep]
66
[file :as file]
7-
[repl :refer [refresh-dirs]]
7+
[repl :as tools.namespace.repl]
88
[track :as tracker]]
99
[refactor-nrepl.core :as core]
1010
[refactor-nrepl.util :as util]
@@ -35,7 +35,7 @@
3535
resolve
3636
deref)
3737
;; corner case - use the mranderson-ized refresh-dirs (for supporting this project's test suite):
38-
refresh-dirs))
38+
tools.namespace.repl/refresh-dirs))
3939

4040
(def default-file-filter-predicate (every-pred core/source-file?
4141
safe-for-clojure-tools-namespace?))
@@ -90,8 +90,9 @@
9090
([]
9191
(project-files-in-topo-order false))
9292
([ignore-errors?]
93-
(let [tracker (build-tracker (util/with-suppressed-errors
94-
(every-pred (partial in-refresh-dirs? refresh-dirs (absolutize-refresh-dirs user-refresh-dirs))
93+
(let [refresh-dirs (user-refresh-dirs)
94+
tracker (build-tracker (util/with-suppressed-errors
95+
(every-pred (partial in-refresh-dirs? refresh-dirs (absolutize-refresh-dirs refresh-dirs))
9596
core/clj-file?)
9697
ignore-errors?))
9798
nses (dep/topo-sort (:clojure.tools.namespace.track/deps tracker))

test/refactor_nrepl/ns/tracker_test.clj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns refactor-nrepl.ns.tracker-test
22
(:require
33
[refactor-nrepl.ns.tracker :as sut]
4-
[clojure.test :refer [are deftest]]))
4+
[clojure.test :refer [are deftest is]]))
55

66
(deftest in-refresh-dirs?
77
(are [refresh-dirs file-ns expected] (= expected
@@ -18,3 +18,8 @@
1818
["src"] "/" false
1919
["ffff"] "src/refactor_nrepl/ns/tracker.clj" false
2020
["src"] "src/refactor_nrepl/ns/trackeeeeeer.clj" false))
21+
22+
(deftest project-files-in-topo-order
23+
(is (seq (sut/project-files-in-topo-order false))
24+
"Does not throw exceptions even when specifying to not ignore errors,
25+
i.e. it doesn't have bugs"))

0 commit comments

Comments
 (0)