Add a generator for the sorted substitution table.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-10-22 17:26:54 +03:00
parent 126a706292
commit 79ae13aa5a
2 changed files with 14 additions and 0 deletions
@@ -22,6 +22,13 @@
1 \a
5 nil))))
(deftest generate-sorted-substitution-table-test
(testing "If the symbol is in the table as a key, then the result won't nil."
(are [symbols expected-table]
(= expected-table (generate-sorted-substitution-table symbols))
"abc" {0 \a 1 \b 2 \c}
"a" {0 \a})))
(deftest encrypt-message-test
(let [symbols "abc"
table {\a 1 \b 2 \c 3}]