Sha256: 27eb2ea1ff160690874945b3c0b5f363268fe2e40e90641d3e5dbfe8b8b7edc8

Contents?: true

Size: 1.78 KB

Versions: 66

Compression:

Stored size: 1.78 KB

Contents

import org.scalatest.{Matchers, FunSuite}

/** @version 1.0.0 */
class HammingTest extends FunSuite with Matchers {

  test("identical strands") {
    Hamming.distance("A", "A") should be (Some(0))
  }

  test("long identical strands") {
    pending
    Hamming.distance("GGACTGA", "GGACTGA") should be (Some(0))
  }

  test("complete distance in single nucleotide strands") {
    pending
    Hamming.distance("A", "G") should be (Some(1))
  }

  test("complete distance in small strands") {
    pending
    Hamming.distance("AG", "CT") should be (Some(2))
  }

  test("small distance in small strands") {
    pending
    Hamming.distance("AT", "CT") should be (Some(1))
  }

  test("small distance") {
    pending
    Hamming.distance("GGACG", "GGTCG") should be (Some(1))
  }

  test("small distance in long strands") {
    pending
    Hamming.distance("ACCAGGG", "ACTATGG") should be (Some(2))
  }

  test("non-unique character in first strand") {
    pending
    Hamming.distance("AGA", "AGG") should be (Some(1))
  }

  test("non-unique character in second strand") {
    pending
    Hamming.distance("AGG", "AGA") should be (Some(1))
  }

  test("same nucleotides in different positions") {
    pending
    Hamming.distance("TAG", "GAT") should be (Some(2))
  }

  test("large distance") {
    pending
    Hamming.distance("GATACA", "GCATAA") should be (Some(4))
  }

  test("large distance in off-by-one strand") {
    pending
    Hamming.distance("GGACGGATTCTG", "AGGACGGATTCT") should be (Some(9))
  }

  test("empty strands") {
    pending
    Hamming.distance("", "") should be (Some(0))
  }

  test("disallow first strand longer") {
    pending
    Hamming.distance("AATG", "AAA") should be (None)
  }

  test("disallow second strand longer") {
    pending
    Hamming.distance("ATA", "AGTG") should be (None)
  }
}

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trackler-2.2.1.39 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.38 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.37 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.36 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.35 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.34 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.33 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.32 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.31 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.30 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.29 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.28 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.27 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.26 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.25 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.24 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.23 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.22 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.21 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala
trackler-2.2.1.20 tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala