Sha256: 52cf58c7e95103d84353afdd257c52b3c441703b295d89562a7767201e8dd254

Contents?: true

Size: 523 Bytes

Versions: 193

Compression:

Stored size: 523 Bytes

Contents

module hamming;

unittest
{
import std.exception : assertThrown;

const int allTestsEnabled = 0;

    assert(distance("A", "A") == 0);
static if (allTestsEnabled)
{
    assert(distance("A", "G") == 1);
    assert(distance("AG", "CT") == 2);
    assert(distance("AT", "CT") == 1);
    assert(distance("GGACG", "GGTCG") == 1);
    assertThrown(distance("AAAG", "AAA"));
    assertThrown(distance("AAA", "AAAG"));
    assert(distance("GATACA", "GCATAA") == 4);
    assert(distance("GGACGGATTCTG", "AGGACGGATTCT") == 9);
}

}

Version data entries

193 entries across 193 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.179 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.178 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.177 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.176 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.175 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.174 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.173 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.172 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.171 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.170 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.169 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.167 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.166 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.165 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.164 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.163 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.162 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.161 tracks/d/exercises/hamming/source/hamming.d
trackler-2.2.1.160 tracks/d/exercises/hamming/source/hamming.d