Sha256: 09a9fde6ba661f7235559cd8bd054596f9183575d6f5c516110f967b63af1d0c

Contents?: true

Size: 1.16 KB

Versions: 116

Compression:

Stored size: 1.16 KB

Contents

-module(etl_tests).

-include_lib("erl_exercism/include/exercism.hrl").
-include_lib("eunit/include/eunit.hrl").

transform_one_value_test() ->
  erl_transform([{1, ["a"]}], [{"a", 1}]).

transform_multiple_keys_from_multiple_values_test() ->
  erl_transform([{1, ["a", "e"]}, {4, ["b"]}], [{"a", 1}, {"b", 4}, {"e", 1}]).

transform_full_dataset_test() ->
  Old = [
         {1,  ["A", "E", "I", "O", "U", "L", "N", "R", "S", "T"]},
         {2,  ["D", "G"]},
         {3,  ["B", "C", "M", "P"]},
         {4,  ["F", "H", "V", "W", "Y"]},
         {5,  ["K"]},
         {8,  ["J", "X"]},
         {10, ["Q", "Z"]}
        ],
  Expected = [
              {"a", 1}, {"b", 3}, {"c", 3}, {"d", 2}, {"e", 1},
              {"f", 4}, {"g", 2}, {"h", 4}, {"i", 1}, {"j", 8},
              {"k", 5}, {"l", 1}, {"m", 3}, {"n", 1}, {"o", 1},
              {"p", 3}, {"q", 10}, {"r", 1}, {"s", 1}, {"t", 1},
              {"u", 1}, {"v", 4}, {"w", 4}, {"x", 8}, {"y", 4},
              {"z", 10}
             ],
  erl_transform(Old, Expected).

erl_transform(Old, New) ->
  ?assertEqual(lists:sort(New), lists:sort(etl:transform(Old))).

version_test() ->
  ?assertMatch(1, etl:test_version()).

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.158 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.157 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.156 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.155 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.154 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.153 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.152 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.151 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.150 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.149 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.148 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.147 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.146 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.145 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.144 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.143 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.142 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.141 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.140 tracks/erlang/exercises/etl/test/etl_tests.erl