File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed
main/clojure/clojure/tools/namespace
test/clojure/clojure/tools/namespace Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 14
14
run : |
15
15
dotnet tool install --global Clojure.Main --version 1.12.0-alpha10
16
16
dotnet tool install --global Clojure.Cljr --version 0.1.0-alpha5
17
+
17
18
- name : Run cljr tests
18
- run : cljr -X:test
19
+ run : cljr -X:test
20
+
Original file line number Diff line number Diff line change 29
29
(mapcat #(find/find-sources-in-dir % platform))
30
30
)) ; ;; ditto: (map #(.getCanonicalFile ^File %))
31
31
32
- (defn- milliseconds-since-epoch [^DateTime time]
33
- (long
34
- (/ (- (.-Ticks time)
35
- (.-Ticks DateTime/UnixEpoch))
36
- TimeSpan/TicksPerMillisecond)))
32
+ (defn- modified-since-tracked? [tracker file]
33
+ (if-let [time (::time tracker)]
34
+ (DateTime/op_LessThan time (.LastWriteTimeUtc ^FileSystemInfo file))
35
+ true ))
37
36
38
37
(defn- modified-files [tracker files]
39
- (filter #( < ( ::time tracker 0 ) ( milliseconds -since-epoch ( .-LastWriteTimeUtc ^FileSystemInfo %))) files)) ; ;; #(< (::time tracker 0) (.lastModified ^File %) )
38
+ (filter ( partial modified -since-tracked? tracker) files)) ; ;; (.lastModified ^File %)
40
39
41
40
(defn- deleted-files [tracker files]
42
41
(set (remove #(file/some-file files %) (::files tracker #{})))) ; ;; (set/difference (::files tracker #{}) (set files))
138
137
(instance? DirectoryInfo x) x
139
138
(string? x) (DirectoryInfo. ^String x)
140
139
:default (DirectoryInfo. (str x))))
141
-
142
-
143
-
Original file line number Diff line number Diff line change 4
4
[clojure.tools.namespace.dir :as dir])
5
5
#_ (:import
6
6
(java.io File)))
7
+
8
+ (defmacro is-not-thrown? [& body]
9
+ `(try
10
+ ~@body
11
+ (is true " No exception thrown" )
12
+ (catch Exception e#
13
+ (is false (str " Expected no exception, but got: " (.GetType e#) " : " (.-Message e#))))))
14
+
15
+ (deftest scan-dirs-does-not-throw
16
+ (is-not-thrown? (dir/scan-dirs {})))
17
+
7
18
; ;; I don't know what the equivalent test would be for .Net.
8
19
#_(defn- make-symbolic-link
9
20
" Reflectively calls java.nio.file.Files/createSymbolicLink on two
35
46
link (File. other-dir " link" )]
36
47
(make-symbolic-link link dir)
37
48
(is (= (::dir/files (dir/scan-dirs {} [dir]))
38
- (::dir/files (dir/scan-dirs {} [link])))))))
49
+ (::dir/files (dir/scan-dirs {} [link])))))))
You can’t perform that action at this time.
0 commit comments