Sha256: 89668fee361b6d3a2e30f906331548e3ef16eac0933210045cdf5801a2e4faac
Contents?: true
Size: 1.17 KB
Versions: 326
Compression:
Stored size: 1.17 KB
Contents
if !System.get_env("EXERCISM_TEST_EXAMPLES") do Code.load_file("hamming.exs", __DIR__) end ExUnit.start ExUnit.configure exclude: :pending, trace: true defmodule HammingTest do use ExUnit.Case test "no difference between empty strands" do assert Hamming.hamming_distance('', '') == {:ok, 0} end @tag :pending test "no difference between identical strands" do assert Hamming.hamming_distance('GGACTGA', 'GGACTGA') == {:ok, 0} end @tag :pending test "small hamming distance in middle somewhere" do assert Hamming.hamming_distance('GGACG', 'GGTCG') == {:ok, 1} end @tag :pending test "distance with same nucleotides in different locations" do assert Hamming.hamming_distance('TAG', 'GAT') == {:ok, 2} end @tag :pending test "larger distance" do assert Hamming.hamming_distance('ACCAGGG', 'ACTATGG') == {:ok, 2} end @tag :pending test "hamming distance is undefined for strands of different lengths" do assert {:error, "Lists must be the same length"} = Hamming.hamming_distance('AAAC', 'TAGGGGAGGCTAGCGGTAGGAC') assert {:error, "Lists must be the same length"} = Hamming.hamming_distance('GACTACGGACAGGACACC', 'GACATCGC') end end
Version data entries
326 entries across 326 versions & 1 rubygems