Sha256: 1bd12badeb5f9061c4328e08d586810151b64ef70a0b1eea120d5056463f701b

Contents?: true

Size: 1.83 KB

Versions: 148

Compression:

Stored size: 1.83 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("atbash_cipher.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule AtbashTest do
  use ExUnit.Case

  # @tag :pending
  test "encode no" do
    assert Atbash.encode("no") == "ml"
  end

  @tag :pending
  test "encode yes" do
    assert Atbash.encode("yes") == "bvh"
  end

  @tag :pending
  test "encode OMG" do
    assert Atbash.encode("OMG") == "lnt"
  end

  @tag :pending
  test "encode O M G" do
    assert Atbash.encode("O M G") == "lnt"
  end

  @tag :pending
  test "encode long word" do
    assert Atbash.encode("mindblowingly") == "nrmwy oldrm tob"
  end

  @tag :pending
  test "encode numbers" do
    assert Atbash.encode("Testing, 1 2 3, testing.") == "gvhgr mt123 gvhgr mt"
  end

  @tag :pending
  test "encode sentence" do
    assert Atbash.encode("Truth is fiction.") == "gifgs rhurx grlm"
  end

  @tag :pending
  test "encode all the things" do
    plaintext = "The quick brown fox jumps over the lazy dog."
    cipher = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
    assert Atbash.encode(plaintext) == cipher
  end

  @tag :pending
  test "decode exercism" do
    cipher = "vcvix rhn"
    plaintext = "exercism"
    assert Atbash.decode(cipher) == plaintext
  end

  @tag :pending
  test "decode a sentence" do
    cipher = "zmlyh gzxov rhlug vmzhg vkkrm thglm v"
    plaintext = "anobstacleisoftenasteppingstone"
    assert Atbash.decode(cipher) == plaintext
  end

  @tag :pending
  test "decode numbers" do
    cipher = "gvhgr mt123 gvhgr mt"
    plaintext = "testing123testing"
    assert Atbash.decode(cipher) == plaintext
  end

  @tag :pending
  test "decode all the letters" do
    cipher = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
    plaintext = "thequickbrownfoxjumpsoverthelazydog"
    assert Atbash.decode(cipher) == plaintext
  end
end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
trackler-2.2.1.109 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.108 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.107 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.106 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.105 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.104 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.103 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.102 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.101 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.100 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.99 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.98 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.97 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.96 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.95 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.94 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.93 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.92 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.91 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs
trackler-2.2.1.90 tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs