-
-
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.
atbash-cipher: Add generators and regenerate tests (#806)
* add generators and regenerate tests * update function templates * indicate why tests were excluded [no important files changed]
- Loading branch information
1 parent
96ec7db
commit 7da2aec
Showing
5 changed files
with
41 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns atbash-cipher-generator) | ||
|
||
(defn update-test-case [test-case] | ||
(-> test-case | ||
(update :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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns atbash-cipher-test | ||
(:require [clojure.test :refer [deftest testing is]] | ||
atbash-cipher)) | ||
|
||
{{#test_cases.encode}} | ||
(deftest encode_test_{{idx}} | ||
(testing {{description}} | ||
(is (= {{expected}} | ||
(atbash-cipher/encode {{input.phrase}}))))) | ||
{{/test_cases.encode}} | ||
|
||
{{#test_cases.decode}} | ||
(deftest decode_test_{{idx}} | ||
(testing {{description}} | ||
(is (= {{expected}} | ||
(atbash-cipher/decode {{input.phrase}}))))) | ||
{{/test_cases.decode}} |
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,11 +1,13 @@ | ||
(ns atbash-cipher) | ||
|
||
(defn encode | ||
[s] | ||
"Encodes the given text using the Atbash cipher." | ||
[plaintext] | ||
;; function body | ||
) | ||
|
||
(defn decode | ||
[s] | ||
"Decodes the given text using the Atbash cipher." | ||
[ciphertext] | ||
;; function body | ||
) |
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