Sha256: 40faec66fe65e51ef885883c3e9aa5382d6544cebc8150f984b92f63429c566a

Contents?: true

Size: 1.36 KB

Versions: 242

Compression:

Stored size: 1.36 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

242 entries across 242 versions & 1 rubygems

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