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.34 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.33 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.32 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.31 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.30 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.29 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.28 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.27 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.26 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.24 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.23 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.22 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.21 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.20 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.19 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.18 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.17 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.16 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.15 tracks/pony/exercises/atbash-cipher/test.pony
trackler-2.0.8.14 tracks/pony/exercises/atbash-cipher/test.pony