Update symbol defaults, factories to have only lower alphabets.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,38 +4,22 @@
|
||||
[cipher-analytical-machine.symbol-factories :refer :all]
|
||||
))
|
||||
|
||||
(deftest lower-english-alphabet-factory-test
|
||||
(let [symbols (lower-english-alphabet-factory)]
|
||||
(deftest english-alphabet-factory-test
|
||||
(let [symbols (english-alphabet-factory)]
|
||||
(testing "It must have the same order."
|
||||
(is (= "abcdefghijklmnopqrstuvwxyz" symbols)))
|
||||
|
||||
(testing "It must have 26 letters."
|
||||
(is (= 26 (count symbols))))))
|
||||
|
||||
(deftest english-alphabet-factory-test
|
||||
(let [symbols (english-alphabet-factory)]
|
||||
(testing "It must have the same order."
|
||||
(is (= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" symbols)))
|
||||
|
||||
(testing "It must have 2*26 letters."
|
||||
(is (= (* 2 26) (count symbols))))))
|
||||
|
||||
(deftest lower-ukrainian-alphabet-factory-test
|
||||
(let [symbols (lower-ukrainian-alphabet-factory)]
|
||||
(deftest ukrainian-alphabet-factory-test
|
||||
(let [symbols (ukrainian-alphabet-factory)]
|
||||
(testing "It must have the same order."
|
||||
(is (= "абвгґдеєжзиіїйклмнопрстуфхцчшщьюя" symbols)))
|
||||
|
||||
(testing "It must have 33 letters."
|
||||
(is (= 33 (count symbols))))))
|
||||
|
||||
(deftest ukrainian-alphabet-factory-test
|
||||
(let [symbols (ukrainian-alphabet-factory)]
|
||||
(testing "It must have the same order."
|
||||
(is (= "абвгґдеєжзиіїйклмнопрстуфхцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ" symbols)))
|
||||
|
||||
(testing "It must have 2*33 letters."
|
||||
(is (= (* 2 33) (count symbols))))))
|
||||
|
||||
(deftest digit-set-factory-test
|
||||
(let [symbols (digit-set-factory)]
|
||||
(testing "It must have the same order."
|
||||
@@ -61,15 +45,15 @@
|
||||
(is (= 3 (count symbols))))))
|
||||
|
||||
(deftest default-symbol-factory-test
|
||||
(testing "If language code is 'en', then it must have symbols."
|
||||
(testing "If language code is 'en', then it must have 27 symbols."
|
||||
(let [symbols (default-symbol-factory "en")]
|
||||
(is (= 70 (count symbols)))))
|
||||
(is (= 27 (count symbols)))))
|
||||
|
||||
(testing "If language code is 'uk', then it must have symbols."
|
||||
(testing "If language code is 'uk', then it must have 34 symbols."
|
||||
(let [symbols (default-symbol-factory "uk")]
|
||||
(is (= 84 (count symbols)))))
|
||||
(is (= 34 (count symbols)))))
|
||||
|
||||
(testing "If language code is unidentified, then it must have the 'en'."
|
||||
(let [symbols (default-symbol-factory "Maybe a code")]
|
||||
(is (= 70 (count symbols))))))
|
||||
(is (= 27 (count symbols))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user