Sha256: 7bf11242b63a9f57865c7bb8fd89bcd4948d27c64b2ae3c62de728c414c5c6c9

Contents?: true

Size: 1.03 KB

Versions: 172

Compression:

Stored size: 1.03 KB

Contents

-module(nucleotide_count_tests).

-define(TESTED_MODULE, (sut(nucleotide_count))).
-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

172 entries across 172 versions & 1 rubygems

Version Path
trackler-2.2.1.62 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.61 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.60 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.59 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.58 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.57 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.56 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.55 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.54 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.53 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.52 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.51 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.50 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.49 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.48 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.47 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.46 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.45 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.44 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl
trackler-2.2.1.43 tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl