Sha256: c8c99b15fddd5adee8a9106c2f1ec01303ab4d251fb6ec42cc8b544bc10bb8f1

Contents?: true

Size: 700 Bytes

Versions: 46

Compression:

Stored size: 700 Bytes

Contents

import ceylon.test { ... }

{[String, String, Integer?]*} cases => {
  ["A", "A", 0],
  ["GGACTGA", "GGACTGA", 0],
  ["A", "G", 1],
  ["AG", "CT", 2],
  ["AT", "CT", 1],
  ["GGACG", "GGTCG", 1],
  ["ACCAGGG", "ACTATGG", 2],
  ["AGA", "AGG", 1],
  ["AGG", "AGA", 1],
  ["TAG", "GAT", 2],
  ["GATACA", "GCATAA", 4],
  ["GGACGGATTCTG", "AGGACGGATTCT", 9],
  ["", "", 0],
  ["AATG", "AAA", null],
  ["ATA", "AGTG", null]
};

test
parameters(`value cases`)
void testHamming(String s1, String s2, Integer? expected) {
  value result = distance(s1, s2);
  if (exists expected) {
    assertEquals(result, expected);
  } else if (!is Error result) {
    fail("should have errored, but got ``result``");
  }
}

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
trackler-2.0.8.43 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.42 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.41 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.40 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.39 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.38 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.37 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.36 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.35 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.34 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.33 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.32 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.31 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.30 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.29 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.28 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.27 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.26 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.24 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon
trackler-2.0.8.23 tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon