Sha256: 77ad9881da7e007a68399e1d65ff6a91e1806f0e95ec6989bec5c935d576c745

Contents?: true

Size: 1.01 KB

Versions: 22

Compression:

Stored size: 1.01 KB

Contents

-module(dna_tests).

-define(TESTED_MODULE, (sut(dna))).
-define(TEST_VERSION, 1).
-include("exercism.hrl").


empty_dna_string_has_no_adenine_test() ->
  ?assertEqual(0, ?TESTED_MODULE:count("", "A")).

repetitive_cytosine_gets_counted_test() ->
  ?assertEqual(5, ?TESTED_MODULE:count("CCCCC", "C")).

counts_only_thymine_test() ->
  ?assertEqual(1, ?TESTED_MODULE:count("GGGGGTAACCCGG", "T")).

validates_nucleotides_test() ->
  ?assertException(error, "Invalid nucleotide", ?TESTED_MODULE:count("GACT", "X")).

empty_dna_string_has_no_nucleotides_test() ->
  ?assertEqual([{"A", 0}, {"T", 0}, {"C", 0}, {"G", 0}], ?TESTED_MODULE:nucleotide_counts("")).

repetitive_sequence_has_only_guanine_test() ->
  ?assertEqual([{"A", 0}, {"T", 0}, {"C", 0}, {"G", 8}], ?TESTED_MODULE:nucleotide_counts("GGGGGGGG")).

counts_all_nucleotides_test() ->
  ?assertEqual(
     [{"A", 20}, {"T", 21}, {"C", 12}, {"G", 17}],
     ?TESTED_MODULE:nucleotide_counts(
       "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")).

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
trackler-2.0.8.7 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.6 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.5 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.4 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.3 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.2 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.8.1 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.7.0 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.44 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.43 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.42 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.41 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.40 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.39 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.38 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.37 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.36 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.35 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.34 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl
trackler-2.0.6.33 tracks/erlang/exercises/nucleotide-count/test/dna_tests.erl