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.139 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.138 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.137 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.136 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.135 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.134 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.133 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.132 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.131 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.130 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.129 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.128 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.127 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.126 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.125 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.124 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.123 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.122 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.121 tracks/erlang/exercises/etl/test/etl_tests.erl
trackler-2.2.1.120 tracks/erlang/exercises/etl/test/etl_tests.erl