Sha256: 811068ab906cc6b3c3e869ffd37d0238003582f4cbdf37d8bd95cb8b3cd2b7f6

Contents?: true

Size: 1.15 KB

Versions: 315

Compression:

Stored size: 1.15 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("nucleotide_count.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule NucleotideCountTest do
  use ExUnit.Case

  # @tag :pending
  test "empty dna string has no adenine" do
    assert NucleotideCount.count('', ?A) == 0
  end

  @tag :pending
  test "repetitive cytosine gets counted" do
    assert NucleotideCount.count('CCCCC', ?C) == 5
  end

  @tag :pending
  test "counts only thymine" do
    assert NucleotideCount.count('GGGGGTAACCCGG', ?T) == 1
  end

  @tag :pending
  test "empty dna string has no nucleotides" do
    expected = %{?A => 0, ?T => 0, ?C => 0, ?G => 0}
    assert NucleotideCount.histogram('') == expected
  end

  @tag :pending
  test "repetitive sequence has only guanine" do
    expected = %{?A => 0, ?T => 0, ?C => 0, ?G => 8}
    assert NucleotideCount.histogram('GGGGGGGG') == expected
  end

  @tag :pending
  test "counts all nucleotides" do
    s = 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC'
    expected = %{?A => 20, ?T => 21, ?C => 12, ?G => 17}
    assert NucleotideCount.histogram(s) == expected
  end
end

Version data entries

315 entries across 315 versions & 1 rubygems

Version Path
trackler-2.2.1.89 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.88 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.87 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.86 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.85 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.84 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.83 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.82 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.81 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.80 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.79 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.78 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.77 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.76 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.75 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.74 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.73 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.72 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.71 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs
trackler-2.2.1.70 tracks/elixir/exercises/nucleotide-count/nucleotide_count_test.exs