Sha256: 66e9277db139e5ca56b3afb13e401c3b7a895745ebddc33d647cb8b3736b209c

Contents?: true

Size: 1.22 KB

Versions: 396

Compression:

Stored size: 1.22 KB

Contents

(defmodule anagram-tests
  (behaviour ltest-unit)
  (export all))

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

(deftest no-matches
  (is-equal () (anagram:find "diaper" '("hello" "world" "zombies" "pants"))))

(deftest detect-simple-anagram
  (is-equal '("tan") (anagram:find "ant" '("tan" "stand" "at"))))

(deftest does-not-confuse-different-duplicates
  (is-equal () (anagram:find "galea" '("eagle"))))

(deftest eliminate-angram-subsets
  (is-equal () (anagram:find "good" '("dog" "goody"))))

(deftest detect-anagram
  (is-equal
    '("inlets")
    (anagram:find "listen" '("enlists" "google" "inlets" "banana"))))

(deftest multiple-anagrams
  (is-equal
    '("gallery" "regally" "largely")
    (anagram:find
      "allergy"
      '("gallery" "ballerina" "regally" "clergy" "largely" "leading"))))

(deftest case-insensitive-subject
  (is-equal
    '("carthorse")
    (anagram:find "Orchestra" '("cashregister" "carthorse" "radishes"))))

(deftest case-insensitive-candidate
  (is-equal
    '("Carthorse")
    (anagram:find "Orchestra" '("cashregister" "Carthorse" "radishes"))))

(deftest does-not-detect-a-word-as-its-own-anagram
  (is-equal
    '("cron")
    (anagram:find "corn" '("corn" "dark" "Corn" "rank" "CORN" "cron" "park"))))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.179 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.178 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.177 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.176 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.175 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.174 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.173 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.172 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.171 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.170 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.169 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.167 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.166 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.165 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.164 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.163 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.162 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.161 tracks/lfe/exercises/anagram/test/anagram-tests.lfe
trackler-2.2.1.160 tracks/lfe/exercises/anagram/test/anagram-tests.lfe