Sha256: a2ac08f931dfdd463bba818615d6d5c39b27e6f97e7cc00666145ee6d2f885c2

Contents?: true

Size: 1.19 KB

Versions: 194

Compression:

Stored size: 1.19 KB

Contents

-module(atbash_cipher_tests).

-define(TESTED_MODULE, (sut(atbash_cipher))).
-define(TEST_VERSION, 1).
-include("exercism.hrl").

encode(Str) ->
    ?TESTED_MODULE:encode(Str).

decode(Str) ->
    ?TESTED_MODULE: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 data entries

194 entries across 194 versions & 1 rubygems

Version Path
trackler-2.2.1.62 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.61 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.60 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.59 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.58 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.57 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.56 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.55 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.54 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.53 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.52 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.51 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.50 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.49 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.48 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.47 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.46 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.45 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.44 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl
trackler-2.2.1.43 tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl