1
exercism fetch lfe parallel-letter-frequency

test/parallel-letter-frequency-tests.lfe

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(defmodule parallel-letter-frequency-tests
  (behaviour ltest-unit)
  (export all))

(include-lib "ltest/include/ltest-macros.lfe")

(deftest single
  (let ((frequencies (parallel-letter-frequency:dict '["asd"])))
    (is-equal (lists:sort (dict:to_list frequencies))
              '[#(#\a 1) #(#\d 1) #(#\s 1)])))

(deftest double
  (let ((frequencies (parallel-letter-frequency:dict '["asd" "asd"])))
    (is-equal (lists:sort (dict:to_list frequencies))
              '[#(#\a 2) #(#\d 2) #(#\s 2)])))