mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-17 12:11:54 -06:00
nucleotide count + robot simulator solutions elixir
This commit is contained in:
37
elixir/nucleotide-count/test/nucleotide_count_test.exs
Normal file
37
elixir/nucleotide-count/test/nucleotide_count_test.exs
Normal file
@@ -0,0 +1,37 @@
|
||||
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
|
||||
Reference in New Issue
Block a user