tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon in trackler-2.0.8.43 vs tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon in trackler-2.0.8.44
- old
+ new
@@ -1,21 +1,37 @@
import ceylon.test { ... }
+// Tests adapted from x-common version 1.0.0
{[String, String, Integer?]*} cases => {
+ // identical strands
["A", "A", 0],
+ // long identical strands
["GGACTGA", "GGACTGA", 0],
+ // complete distance in single nucleotide strands
["A", "G", 1],
+ // complete distance in small strands
["AG", "CT", 2],
+ // small distance in small strands
["AT", "CT", 1],
+ // small distance
["GGACG", "GGTCG", 1],
+ // small distance in long strands
["ACCAGGG", "ACTATGG", 2],
+ // non-unique character in first strand
["AGA", "AGG", 1],
+ // non-unique character in second strand
["AGG", "AGA", 1],
+ // same nucleotides in different positions
["TAG", "GAT", 2],
+ // large distance
["GATACA", "GCATAA", 4],
+ // large distance in off-by-one strand
["GGACGGATTCTG", "AGGACGGATTCT", 9],
+ // empty strands
["", "", 0],
+ // disallow first strand longer
["AATG", "AAA", null],
+ // disallow second strand longer
["ATA", "AGTG", null]
};
test
parameters(`value cases`)