Sha256: 3a5c79c8a5875f27e83375f8795638795b5fa282fef9aac42462d970aa771ee8

Contents?: true

Size: 1.25 KB

Versions: 116

Compression:

Stored size: 1.25 KB

Contents

-module(atbash_cipher_tests).

-include_lib("erl_exercism/include/exercism.hrl").
-include_lib("eunit/include/eunit.hrl").

encode(Str) ->
    atbash_cipher:encode(Str).

decode(Str) ->
    atbash_cipher:decode(Str).

encode_no_test() ->
    ?assertEqual("ml", encode("no")).

encode_yes_test() ->
    ?assertEqual("bvh", encode("yes")).

encode_OMG_test() ->
    ?assertEqual("lnt", encode("OMG")).

encode_O_M_G_test() ->
    ?assertEqual("lnt", encode("O M G")).

encode_long_word_test() ->
    ?assertEqual("nrmwy oldrm tob", encode("mindblowingly")).

encode_numbers_test() ->
    ?assertEqual("gvhgr mt123 gvhgr mt",
                 encode("Testing, 1 2 3, testing.")).

encode_sentence_test() ->
    ?assertEqual("gifgs rhurx grlm",
                 encode("Truth is fiction.")).

encode_all_things_test() ->
    Plaintext = "The quick brown fox jumps over the lazy dog.",
    Ciphertext = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
    ?assertEqual(Ciphertext, encode(Plaintext)).

decode_word_test() ->
    ?assertEqual("exercism", decode("vcvix rhn")).

decode_sentence_test() ->
    ?assertEqual("anobstacleisoftenasteppingstone",
                 decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v")).

version_test() ->
  ?assertMatch(1, atbash_cipher:test_version()).

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.179 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.178 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.177 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.176 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.175 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.174 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.173 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.172 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.171 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.170 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.169 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.167 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.166 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.165 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.164 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.163 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.162 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.161 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.160 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl