Sha256: 6709c5de8a3f8c63a30a0a59999e6584f4553a26b777228f8e8dc15c0fb40f40

Contents?: true

Size: 1.15 KB

Versions: 115

Compression:

Stored size: 1.15 KB

Contents

import org.scalatest._

class HammingTest extends FlatSpec with Matchers {
  it should "detect no difference between empty strands" in {
    Hamming.compute("", "") should be (Some(0))
  }

  it should "detect no difference between identical strands" in {
    pending
    Hamming.compute("GGACTGA", "GGACTGA") should be (Some(0))
  }

  it should "detect complete hamming distance in small strand" in {
    pending
    Hamming.compute("ACT", "GGA") should be (Some(3))
  }

  it should "give hamming distance in off by one strand" in {
    pending
    Hamming.compute("GGACGGATTCTG", "AGGACGGATTCT") should be (Some(9))
  }

  it should "give small hamming distance in middle somewhere" in {
    pending
    Hamming.compute("GGACG", "GGTCG") should be (Some(1))
  }

  it should "give a larger distance" in {
    pending
    Hamming.compute("ACCAGGG", "ACTATGG") should be (Some(2))
  }

  it should "be undefined for first String longer" in {
    pending
    Hamming.compute("AGGCTAGCGGTAGGAC", "AAACTAGGGG") should be (None)
  }

  it should "be undefined for second String longer" in {
    pending
    Hamming.compute("AAACTAGGGG", "AGGCTAGCGGTAGGAC") should be (None)
  }
}

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
trackler-2.1.0.36 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.34 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.33 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.32 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.31 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.30 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.29 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.28 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.27 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.26 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.25 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.24 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.23 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.22 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.21 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.20 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.19 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.18 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.17 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.1.0.16 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala