Sha256: 100e636e01afd949e34749fb84089e1c327fee47095fbccf041f513608851208

Contents?: true

Size: 1.49 KB

Versions: 65

Compression:

Stored size: 1.49 KB

Contents

use "ponytest"

actor Main is TestList
  new create(env: Env) => 
    PonyTest(env, this)

  fun tag tests(test: PonyTest) =>
    test(_TestAtbashEncode)
    test(_TestAtbashDecode)

class iso _TestAtbashEncode is UnitTest
  fun name(): String => "atbash-cipher/Atbash.encode"

  fun apply(h: TestHelper) =>
    let tests = [
      (
        "yes",
        "bvh"
      ),(
        "no",
        "ml"
      ),(
        "OMG",
        "lnt"
      ),(
        "O M G",
        "lnt"
      ),(
        "mindblowingly",
        "nrmwy oldrm tob"
      ),(
        "Testing,1 2 3, testing.",
        "gvhgr mt123 gvhgr mt"
      ),(
        "Truth is fiction.",
        "gifgs rhurx grlm"
      ),(
        "The quick brown fox jumps over the lazy dog.",
        "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
      )
    ]
    for (input, expected) in tests.values() do
      h.assert_eq[String](Atbash.encode(input), expected)
    end

class iso _TestAtbashDecode is UnitTest
  fun name(): String => "atbash-cipher/Atbash.decode"

  fun apply(h: TestHelper) =>
    let tests = [
      (
        "vcvix rhn",
        "exercism"
      ),(
        "zmlyh gzxov rhlug vmzhg vkkrm thglm v",
        "anobstacleisoftenasteppingstone"
      ),(
        "gvhgr mt123 gvhgr mt",
        "testing123testing"
      ),(
        "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
        "thequickbrownfoxjumpsoverthelazydog"
      )
    ]
    for (input, expected) in tests.values() do
      h.assert_eq[String](Atbash.decode(input), expected)
    end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
trackler-2.0.8.54 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.53 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.52 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.51 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.50 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.49 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.48 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.47 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.46 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.45 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.44 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.43 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.42 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.41 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.40 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.39 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.38 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.37 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.36 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.35 tracks/pony/exercises/atbash-cipher/test.pony