|
30 | 30 | (deftest decode_test_1
|
31 | 31 | (testing "Random key cipher ▶ Can decode"
|
32 | 32 | (let [key (simple-cipher/rand-key)]
|
33 |
| - (is (= "aaaaaaaaaa" (simple-cipher/decode key (subs key 0 (count "aaaaaaaaaa"))))))) |
| 33 | + (is (= "aaaaaaaaaa" (simple-cipher/decode key (subs key 0 (count "aaaaaaaaaa")))))))) |
34 | 34 |
|
35 |
| - (deftest decode_test_2 |
36 |
| - (testing "Random key cipher ▶ Is reversible. I.e., if you apply decode in a encoded result, you must see the same plaintext encode parameter as a result of the decode method" |
37 |
| - (let [key (simple-cipher/rand-key)] |
38 |
| - (is (= "abcdefghij" (simple-cipher/decode key (simple-cipher/encode key "abcdefghij"))))) |
| 35 | +(deftest decode_test_2 |
| 36 | + (testing "Random key cipher ▶ Is reversible. I.e., if you apply decode in a encoded result, you must see the same plaintext encode parameter as a result of the decode method" |
| 37 | + (let [key (simple-cipher/rand-key)] |
| 38 | + (is (= "abcdefghij" (simple-cipher/decode key (simple-cipher/encode key "abcdefghij"))))))) |
39 | 39 |
|
40 |
| - (deftest decode_test_3 |
41 |
| - (testing "Substitution cipher ▶ Can decode" |
42 |
| - (is (= "aaaaaaaaaa" (simple-cipher/decode "abcdefghij" "abcdefghij")))))) |
| 40 | +(deftest decode_test_3 |
| 41 | + (testing "Substitution cipher ▶ Can decode" |
| 42 | + (is (= "aaaaaaaaaa" (simple-cipher/decode "abcdefghij" "abcdefghij"))))) |
43 | 43 |
|
44 |
| - (deftest decode_test_4 |
45 |
| - (testing "Substitution cipher ▶ Is reversible. I.e., if you apply decode in a encoded result, you must see the same plaintext encode parameter as a result of the decode method" |
46 |
| - (is (= "abcdefghij" (simple-cipher/decode "abcdefghij" (simple-cipher/encode "abcdefghij" "abcdefghij")))))) |
| 44 | +(deftest decode_test_4 |
| 45 | + (testing "Substitution cipher ▶ Is reversible. I.e., if you apply decode in a encoded result, you must see the same plaintext encode parameter as a result of the decode method" |
| 46 | + (is (= "abcdefghij" (simple-cipher/decode "abcdefghij" (simple-cipher/encode "abcdefghij" "abcdefghij")))))) |
47 | 47 |
|
48 |
| - (deftest decode_test_5 |
49 |
| - (testing "Substitution cipher ▶ Can wrap on decode" |
50 |
| - (is (= "zzzzzzzzzz" (simple-cipher/decode "abcdefghij" "zabcdefghi")))))) |
| 48 | +(deftest decode_test_5 |
| 49 | + (testing "Substitution cipher ▶ Can wrap on decode" |
| 50 | + (is (= "zzzzzzzzzz" (simple-cipher/decode "abcdefghij" "zabcdefghi"))))) |
51 | 51 |
|
52 |
| - (deftest decode_test_6 |
53 |
| - (testing "Substitution cipher ▶ Can decode messages longer than the key" |
54 |
| - (is (= "iamapandabear" (simple-cipher/decode "abc" "iboaqcnecbfcr")))))) |
| 52 | +(deftest decode_test_6 |
| 53 | + (testing "Substitution cipher ▶ Can decode messages longer than the key" |
| 54 | + (is (= "iamapandabear" (simple-cipher/decode "abc" "iboaqcnecbfcr"))))) |
0 commit comments