Skip to content

Commit c54477b

Browse files
Restore example file
1 parent ca77a6d commit c54477b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ pom.xml.asc
2424
**/*/*.ipynb_checkpoints
2525
concepts/functions-generating-functions/introduction_files/
2626
concepts/functions-generating-functions/*.html
27+
exercises/**/*.bak

test.clj

+13-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@
3535
example (if practice?
3636
(str dir ".meta/example.clj")
3737
(str dir ".meta/exemplar.clj"))
38-
src (str dir "src/" (->snake_case slug) ".clj")]
39-
(shell/sh "cp" example src)
40-
(= "pass" ((json/parse-string
41-
(:out (shell/sh (str test-runner-dir "test-runner.clj")
42-
slug
43-
dir
44-
dir)))
45-
"status"))))
38+
src (str dir "src/" (->snake_case slug) ".clj")
39+
src-copy (str src ".bak")]
40+
(shell/sh "cp" src src-copy)
41+
(try
42+
((shell/sh "cp" example src)
43+
(= "pass" ((json/parse-string
44+
(:out (shell/sh (str test-runner-dir "test-runner.clj")
45+
slug
46+
dir
47+
dir)))
48+
"status")))
49+
(finally (shell/sh "mv" src-copy src)))))
50+
4651

4752
(defn test-exercises! []
4853
(let [exercises (or (seq (take 1 *command-line-args*))

0 commit comments

Comments
 (0)