-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve naming of extension functions
- Loading branch information
1 parent
afc787d
commit bd75601
Showing
9 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
(ns difference-of-squares-generator) | ||
|
||
(defn- update-path [path] | ||
(take-last 1 path)) | ||
|
||
(defn transform [test-cases] | ||
(map #(update % :path update-path) test-cases)) | ||
(defn update-test-case [test-case] | ||
(update test-case :path #(take-last 1 %))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(ns high-scores-generator) | ||
|
||
(defn- transform-test-case [test-case] | ||
(defn update-test-case [test-case] | ||
(-> test-case | ||
(update-in [:input :scores] #(apply list %)) | ||
(update-in [:expected] #(if (vector? %) (apply list %) %)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(ns largest-series-product-generator) | ||
|
||
(defn transform-test-case [test-case] | ||
(defn update-test-case [test-case] | ||
(if-let [error (get-in test-case [:expected :error])] | ||
(assoc-in test-case [:expected :error] (str "^" error "$")) | ||
test-case)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(ns sum-of-multiples-generator) | ||
|
||
(defn- transform-test-case [test-case] | ||
(defn update-test-case [test-case] | ||
(update-in test-case [:input :factors] #(apply list %))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters