1
exercism fetch erlang parallel-letter-frequency

test/parallel_letter_frequency_tests.erl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-module( parallel_letter_frequency_tests ).

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

single_test() ->
  Frequencies = dict:to_list( parallel_letter_frequency:dict(["asd"]) ),
  ?assert( lists:sort(Frequencies) =:= [{$a,1},{$d,1},{$s,1}] ).

double_test() ->
  Frequencies = dict:to_list( parallel_letter_frequency:dict(["asd", "asd"]) ),
  ?assert( lists:sort(Frequencies) =:= [{$a,2},{$d,2},{$s,2}] ).

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