Sha256: 80c7f53d33c07a4e895a2d4f20cead433a4d78655ed782f088317c00efc425c3

Contents?: true

Size: 1016 Bytes

Versions: 165

Compression:

Stored size: 1016 Bytes

Contents

use "ponytest"

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

  fun tag tests(test: PonyTest) =>
    test(_TestHammingDistance)

class iso _TestHammingDistance is UnitTest
  fun name(): String => "hamming/HammingDistance"

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

    h.assert_error({()? => HammingDistance("GAT", "GA")? })
    h.assert_error({()? => HammingDistance("GA", "GAC")? })

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
trackler-2.2.1.58 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.57 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.56 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.55 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.54 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.53 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.52 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.51 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.50 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.49 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.48 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.47 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.46 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.45 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.44 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.43 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.42 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.41 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.40 tracks/pony/exercises/hamming/test.pony
trackler-2.2.1.39 tracks/pony/exercises/hamming/test.pony