Sha256: 0ca0120475b1b95badf85e17871e3a206739117895e8acaab6a90fc7803a2b00

Contents?: true

Size: 845 Bytes

Versions: 382

Compression:

Stored size: 845 Bytes

Contents

require "spec"
require "../src/*"

describe "Hamming" do
  describe "#compute" do
    it "computes no difference for identical single nucleotide strands" do
      Hamming.compute("A", "A").should eq 0
    end

    pending "computes a distance for single nucleotide strands" do
      Hamming.compute("A", "G").should eq 1
    end

    pending "computes a distance for small strands" do
      Hamming.compute("AG", "CT").should eq 2
    end

    pending "computes a distance for medium strands" do
      Hamming.compute("GGACG", "GGTCG").should eq 1
    end

    pending "computes a distance for large strands" do
      Hamming.compute("GGACGGATTCTG", "AGGACGGATTCT").should eq 9
    end

    pending "raises an exception when strands aren't of equal length" do
      expect_raises(ArgumentError) { Hamming.compute("GCC", "A") }
    end
  end
end

Version data entries

382 entries across 382 versions & 1 rubygems

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