Sha256: fc2af497865e40b50b545dfbc7d67f065bd368395155ec06c29a7905d7e55011

Contents?: true

Size: 1.15 KB

Versions: 44

Compression:

Stored size: 1.15 KB

Contents

use "ponytest"

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

  new make() =>
    None

  fun tag tests(test: PonyTest) =>
    test(_HammingDistanceTest)
    test(_HammingParamTest)

class iso _HammingDistanceTest is UnitTest
  """
  Test Hamming package returns the right distance
  """
  fun name(): String => "hamming/Hamming"

  fun apply(h: TestHelper): None ? =>
    h.assert_eq[U8](0, Hamming("A", "A"))
    h.assert_eq[U8](0, Hamming("GGACTGA", "GGACTGA"))
    h.assert_eq[U8](1, Hamming("A", "G"))
    h.assert_eq[U8](2, Hamming("AG", "CT"))
    h.assert_eq[U8](1, Hamming("AT", "CT"))
    h.assert_eq[U8](1, Hamming("GGACG", "GGTCG"))
    h.assert_eq[U8](2, Hamming("ACCAGGG", "ACTATGG"))
    h.assert_eq[U8](1, Hamming("AGG", "AGA"))
    h.assert_eq[U8](4, Hamming("GATACA", "GCATAA"))
    h.assert_eq[U8](9, Hamming("GGACGGATTCTG", "AGGACGGATTCT"))

 class iso _HammingParamTest is UnitTest
  """
  Test Hamming package returns the right distance
  """
  fun name(): String => "hamming/Hamming"

  fun apply(h: TestHelper) =>
    h.assert_error(lambda()? => Hamming("GAT", "GA") end)
    h.assert_error(lambda()? => Hamming("GA", "GAC") end)

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
trackler-2.0.6.0 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.18 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.17 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.16 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.15 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.14 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.13 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.12 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.11 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.10 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.9 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.8 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.7 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.6 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.5 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.4 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.3 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.2 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.1 tracks/pony/exercises/hamming/test.pony
trackler-2.0.5.0 tracks/pony/exercises/hamming/test.pony