Sha256: a521a0df52f0c19d9c6a3f7862fcdc85025db1e6da48244769f69f1c662a1414

Contents?: true

Size: 1.23 KB

Versions: 396

Compression:

Stored size: 1.23 KB

Contents

(ns anagram-test
  (:require [clojure.test :refer [deftest is]]
            anagram))

(deftest no-matches
  (is (= []
         (anagram/anagrams-for "diaper" ["hello" "world" "zombies" "pants"]))))

(deftest detect-simple-anagram
  (is (= ["tan"] (anagram/anagrams-for "ant" ["tan" "stand" "at"]))))

(deftest does-not-confuse-different-duplicates
  (is (= [] (anagram/anagrams-for "galea" ["eagle"]))))

(deftest eliminate-anagram-subsets
  (is (= [] (anagram/anagrams-for "good" ["dog" "goody"]))))

(deftest detect-anagram
  (is (= ["inlets"]
         (let [coll ["enlists" "google" "inlets" "banana"]]
           (anagram/anagrams-for "listen" coll)))))

(deftest multiple-anagrams
  (is (= ["gallery" "regally" "largely"]
         (let [coll ["gallery" "ballerina" "regally"
                     "clergy"  "largely"   "leading"]]
           (anagram/anagrams-for "allergy" coll)))))

(deftest case-insensitive-anagrams
  (is (= ["Carthorse"]
         (let [coll ["cashregister" "Carthorse" "radishes"]]
           (anagram/anagrams-for "Orchestra" coll)))))

(deftest word-is-not-own-anagram
  (is (= [] (anagram/anagrams-for "banana" ["banana"]))))

(deftest capital-word-is-not-own-anagram
  (is (= [] (anagram/anagrams-for "BANANA" ["banana"]))))

Version data entries

396 entries across 396 versions & 1 rubygems

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