|
|
@ -51,14 +51,20 @@
|
|
|
|
(testing "The message 'abc' is encrypted to 'bca'"
|
|
|
|
(testing "The message 'abc' is encrypted to 'bca'"
|
|
|
|
(is (= "bca" (encrypt-message "abc" 1 symbols))))
|
|
|
|
(is (= "bca" (encrypt-message "abc" 1 symbols))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(testing "The message 'ABC' is encrypted to 'bca', because of case-insensitive."
|
|
|
|
|
|
|
|
(is (= "bca" (encrypt-message "ABC" 1 symbols))))
|
|
|
|
|
|
|
|
|
|
|
|
(testing "The message 'bca' is decrypted to 'abc'"
|
|
|
|
(testing "The message 'bca' is decrypted to 'abc'"
|
|
|
|
(is (= "abc" (encrypt-message "bca" -1 symbols))))))
|
|
|
|
(is (= "abc" (encrypt-message "bca" -1 symbols))))))
|
|
|
|
|
|
|
|
|
|
|
|
(deftest decrypt-message-text
|
|
|
|
(deftest decrypt-message-text
|
|
|
|
(let [symbols "abc"]
|
|
|
|
(let [symbols "abc"]
|
|
|
|
(testing "The message 'bca' is decrypted to 'abc'"
|
|
|
|
(testing "The message 'bca' is decrypted to 'abc'"
|
|
|
|
(is (= "abc" (decrypt-message "bca" 1 symbols)))
|
|
|
|
(is (= "abc" (decrypt-message "bca" 1 symbols))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(testing "The message 'BCA' is decrypted to 'abc', because of case-insensitive."
|
|
|
|
|
|
|
|
(is (= "abc" (decrypt-message "BCA" 1 symbols))))
|
|
|
|
|
|
|
|
|
|
|
|
(testing "The message 'abc' is encrypted to 'bca'"
|
|
|
|
(testing "The message 'abc' is encrypted to 'bca'"
|
|
|
|
(is (= "bca" (decrypt-message "abc" -1 symbols)))))))
|
|
|
|
(is (= "bca" (decrypt-message "abc" -1 symbols))))))
|
|
|
|
|
|
|
|
|
|
|
|