Sha256: 9344836a47be4788e8c9ea957f82926ea0b05f03b0df61d34a9da1a4f2a14623

Contents?: true

Size: 1012 Bytes

Versions: 318

Compression:

Stored size: 1012 Bytes

Contents

using Base.Test

include("hamming.jl")

@testset "identical strands" begin
    @test distance("A", "A") == 0
    @test distance("GGACTGA", "GGACTGA") == 0
end

@testset "complete distance" begin
    @test distance("A", "G") == 1
    @test distance("AG", "CT") == 2
end

@testset "small distance" begin
    @test distance("AT", "CT") == 1
    @test distance("GGACG", "GGTCG") == 1
    @test distance("ACCAGGG", "ACTATGG") == 2
end

@testset "non-unique characters" begin
    @test distance("AGA", "AGG") == 1
    @test distance("AGG", "AGA") == 1
end

@testset "same nucleotides in different positions" begin
    @test distance("TAG", "GAT") == 2
end

@testset "large distance" begin
    @test distance("GATACA", "GCATAA") == 4
    @test distance("GGACGGATTCTG", "AGGACGGATTCT") == 9
end

@testset "empty strands" begin
    @test distance("", "") == 0
end

@testset "different strand lengths" begin
    @test_throws ArgumentError distance("AATG", "AAA")
    @test_throws ArgumentError distance("ATA", "AGTG")
end

Version data entries

318 entries across 318 versions & 1 rubygems

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